mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 21:37:59 +00:00
Moved tags to aws iam provider inputs
This commit is contained in:
@@ -166,7 +166,6 @@ export const dynamicSecretLeaseServiceFactory = ({
|
||||
usernameTemplate: dynamicSecretCfg.usernameTemplate,
|
||||
identity,
|
||||
metadata: { projectId },
|
||||
tags: dynamicSecretCfg.tags as Record<string, string>[] | undefined,
|
||||
config
|
||||
});
|
||||
} catch (error: unknown) {
|
||||
|
||||
@@ -79,7 +79,6 @@ export const dynamicSecretServiceFactory = ({
|
||||
defaultTTL,
|
||||
actorAuthMethod,
|
||||
metadata,
|
||||
tags,
|
||||
usernameTemplate
|
||||
}: TCreateDynamicSecretDTO) => {
|
||||
const project = await projectDAL.findProjectBySlug(projectSlug, actorOrgId);
|
||||
@@ -166,8 +165,7 @@ export const dynamicSecretServiceFactory = ({
|
||||
folderId: folder.id,
|
||||
name,
|
||||
gatewayId: selectedGatewayId,
|
||||
usernameTemplate,
|
||||
tags: JSON.stringify(tags)
|
||||
usernameTemplate
|
||||
},
|
||||
tx
|
||||
);
|
||||
@@ -204,9 +202,10 @@ export const dynamicSecretServiceFactory = ({
|
||||
actorOrgId,
|
||||
actorAuthMethod,
|
||||
metadata,
|
||||
tags,
|
||||
usernameTemplate
|
||||
}: TUpdateDynamicSecretDTO) => {
|
||||
console.log({ inputs });
|
||||
|
||||
const project = await projectDAL.findProjectBySlug(projectSlug, actorOrgId);
|
||||
if (!project) throw new NotFoundError({ message: `Project with slug '${projectSlug}' not found` });
|
||||
|
||||
@@ -318,8 +317,7 @@ export const dynamicSecretServiceFactory = ({
|
||||
name: newName ?? name,
|
||||
status: null,
|
||||
gatewayId: selectedGatewayId,
|
||||
usernameTemplate,
|
||||
tags: JSON.stringify(tags)
|
||||
usernameTemplate
|
||||
},
|
||||
tx
|
||||
);
|
||||
|
||||
@@ -23,7 +23,6 @@ export type TCreateDynamicSecretDTO = {
|
||||
projectSlug: string;
|
||||
metadata?: ResourceMetadataDTO;
|
||||
usernameTemplate?: string | null;
|
||||
tags?: ResourceMetadataDTO;
|
||||
} & Omit<TProjectPermission, "projectId">;
|
||||
|
||||
export type TUpdateDynamicSecretDTO = {
|
||||
@@ -36,7 +35,6 @@ export type TUpdateDynamicSecretDTO = {
|
||||
inputs?: TProvider["inputs"];
|
||||
projectSlug: string;
|
||||
metadata?: ResourceMetadataDTO;
|
||||
tags?: ResourceMetadataDTO;
|
||||
usernameTemplate?: string | null;
|
||||
} & Omit<TProjectPermission, "projectId">;
|
||||
|
||||
|
||||
@@ -119,20 +119,20 @@ export const AwsIamProvider = (): TDynamicProviderFns => {
|
||||
identity?: {
|
||||
name: string;
|
||||
};
|
||||
tags?: Record<string, string>[];
|
||||
metadata: { projectId: string };
|
||||
}) => {
|
||||
const { inputs, usernameTemplate, metadata, identity, tags } = data;
|
||||
const { inputs, usernameTemplate, metadata, identity } = data;
|
||||
|
||||
const providerInputs = await validateProviderInputs(inputs);
|
||||
console.log({ providerInputs, inputs });
|
||||
const client = await $getClient(providerInputs, metadata.projectId);
|
||||
|
||||
const username = generateUsername(usernameTemplate, identity);
|
||||
const { policyArns, userGroups, policyDocument, awsPath, permissionBoundaryPolicyArn } = providerInputs;
|
||||
const awsTags = [{ Key: "createdBy", Value: "infisical-dynamic-secret" }];
|
||||
|
||||
if (tags && Array.isArray(tags)) {
|
||||
const additionalTags = tags.map((tag) => ({
|
||||
if (providerInputs.tags && Array.isArray(providerInputs.tags)) {
|
||||
const additionalTags = providerInputs.tags.map((tag) => ({
|
||||
Key: tag.key,
|
||||
Value: tag.value
|
||||
}));
|
||||
|
||||
@@ -2,6 +2,7 @@ import RE2 from "re2";
|
||||
import { z } from "zod";
|
||||
|
||||
import { CharacterType, characterValidator } from "@app/lib/validator/validate-string";
|
||||
import { ResourceMetadataSchema } from "@app/services/resource-metadata/resource-metadata-schema";
|
||||
|
||||
import { TDynamicSecretLeaseConfig } from "../../dynamic-secret-lease/dynamic-secret-lease-types";
|
||||
|
||||
@@ -207,7 +208,8 @@ export const DynamicSecretAwsIamSchema = z.preprocess(
|
||||
permissionBoundaryPolicyArn: z.string().trim().optional(),
|
||||
policyDocument: z.string().trim().optional(),
|
||||
userGroups: z.string().trim().optional(),
|
||||
policyArns: z.string().trim().optional()
|
||||
policyArns: z.string().trim().optional(),
|
||||
tags: ResourceMetadataSchema.optional()
|
||||
}),
|
||||
z.object({
|
||||
method: z.literal(AwsIamAuthType.AssumeRole),
|
||||
@@ -217,7 +219,8 @@ export const DynamicSecretAwsIamSchema = z.preprocess(
|
||||
permissionBoundaryPolicyArn: z.string().trim().optional(),
|
||||
policyDocument: z.string().trim().optional(),
|
||||
userGroups: z.string().trim().optional(),
|
||||
policyArns: z.string().trim().optional()
|
||||
policyArns: z.string().trim().optional(),
|
||||
tags: ResourceMetadataSchema.optional()
|
||||
})
|
||||
])
|
||||
);
|
||||
@@ -525,7 +528,6 @@ export type TDynamicProviderFns = {
|
||||
name: string;
|
||||
};
|
||||
metadata: { projectId: string };
|
||||
tags?: Record<string, string>[];
|
||||
config?: TDynamicSecretLeaseConfig;
|
||||
}) => Promise<{ entityId: string; data: unknown }>;
|
||||
validateConnection: (inputs: unknown, metadata: { projectId: string }) => Promise<boolean>;
|
||||
|
||||
Reference in New Issue
Block a user