mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 07:30:20 +00:00
feature: project templates with docs
This commit is contained in:
@@ -169,7 +169,8 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
||||
})
|
||||
.optional()
|
||||
.describe(PROJECTS.CREATE.slug),
|
||||
kmsKeyId: z.string().optional()
|
||||
kmsKeyId: z.string().optional(),
|
||||
templateId: z.string().uuid().optional().describe(PROJECTS.CREATE.templateId)
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
@@ -186,7 +187,8 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
||||
actorAuthMethod: req.permission.authMethod,
|
||||
workspaceName: req.body.projectName,
|
||||
slug: req.body.slug,
|
||||
kmsKeyId: req.body.kmsKeyId
|
||||
kmsKeyId: req.body.kmsKeyId,
|
||||
templateId: req.body.templateId
|
||||
});
|
||||
|
||||
await server.services.telemetry.sendPostHogEvents({
|
||||
@@ -199,6 +201,20 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
||||
}
|
||||
});
|
||||
|
||||
if (req.body.templateId) {
|
||||
await server.services.auditLog.createAuditLog({
|
||||
...req.auditLogInfo,
|
||||
orgId: req.permission.orgId,
|
||||
event: {
|
||||
type: EventType.APPLY_PROJECT_TEMPLATE,
|
||||
metadata: {
|
||||
templateId: req.body.templateId,
|
||||
projectId: project.id
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return { project };
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user