mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 10:35:17 +00:00
requested changes
This commit is contained in:
@@ -7,7 +7,7 @@ import { daysToMillisecond } from "@app/lib/dates";
|
||||
import { removeTrailingSlash } from "@app/lib/fn";
|
||||
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { DefaultResponseErrorsSchema, SanitizedDynamicSecretSchema } from "@app/server/routes/sanitizedSchemas";
|
||||
import { SanitizedDynamicSecretSchema } from "@app/server/routes/sanitizedSchemas";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
export const registerDynamicSecretLeaseRouter = async (server: FastifyZodProvider) => {
|
||||
@@ -37,7 +37,6 @@ export const registerDynamicSecretLeaseRouter = async (server: FastifyZodProvide
|
||||
environmentSlug: z.string().min(1).describe(DYNAMIC_SECRET_LEASES.CREATE.path)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
lease: DynamicSecretLeasesSchema,
|
||||
dynamicSecret: SanitizedDynamicSecretSchema,
|
||||
@@ -82,7 +81,6 @@ export const registerDynamicSecretLeaseRouter = async (server: FastifyZodProvide
|
||||
isForced: z.boolean().default(false).describe(DYNAMIC_SECRET_LEASES.DELETE.isForced)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
lease: DynamicSecretLeasesSchema
|
||||
})
|
||||
@@ -136,7 +134,6 @@ export const registerDynamicSecretLeaseRouter = async (server: FastifyZodProvide
|
||||
environmentSlug: z.string().min(1).describe(DYNAMIC_SECRET_LEASES.RENEW.environmentSlug)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
lease: DynamicSecretLeasesSchema
|
||||
})
|
||||
@@ -177,7 +174,6 @@ export const registerDynamicSecretLeaseRouter = async (server: FastifyZodProvide
|
||||
environmentSlug: z.string().min(1).describe(DYNAMIC_SECRET_LEASES.GET_BY_LEASEID.environmentSlug)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
lease: DynamicSecretLeasesSchema.extend({
|
||||
dynamicSecret: SanitizedDynamicSecretSchema
|
||||
|
||||
@@ -9,7 +9,7 @@ import { daysToMillisecond } from "@app/lib/dates";
|
||||
import { removeTrailingSlash } from "@app/lib/fn";
|
||||
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { DefaultResponseErrorsSchema, SanitizedDynamicSecretSchema } from "@app/server/routes/sanitizedSchemas";
|
||||
import { SanitizedDynamicSecretSchema } from "@app/server/routes/sanitizedSchemas";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
export const registerDynamicSecretRouter = async (server: FastifyZodProvider) => {
|
||||
@@ -59,7 +59,6 @@ export const registerDynamicSecretRouter = async (server: FastifyZodProvider) =>
|
||||
})
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
dynamicSecret: SanitizedDynamicSecretSchema
|
||||
})
|
||||
@@ -91,7 +90,6 @@ export const registerDynamicSecretRouter = async (server: FastifyZodProvider) =>
|
||||
clientSecret: z.string().min(1).describe("The client secret of the Azure Entra ID App Registration")
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z
|
||||
.object({
|
||||
name: z.string().min(1).describe("The name of the user"),
|
||||
@@ -157,7 +155,6 @@ export const registerDynamicSecretRouter = async (server: FastifyZodProvider) =>
|
||||
})
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
dynamicSecret: SanitizedDynamicSecretSchema
|
||||
})
|
||||
@@ -197,7 +194,6 @@ export const registerDynamicSecretRouter = async (server: FastifyZodProvider) =>
|
||||
isForced: z.boolean().default(false).describe(DYNAMIC_SECRETS.DELETE.isForced)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
dynamicSecret: SanitizedDynamicSecretSchema
|
||||
})
|
||||
@@ -233,7 +229,6 @@ export const registerDynamicSecretRouter = async (server: FastifyZodProvider) =>
|
||||
environmentSlug: z.string().min(1).describe(DYNAMIC_SECRETS.GET_BY_NAME.environmentSlug)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
dynamicSecret: SanitizedDynamicSecretSchema.extend({
|
||||
inputs: z.unknown()
|
||||
@@ -268,7 +263,6 @@ export const registerDynamicSecretRouter = async (server: FastifyZodProvider) =>
|
||||
environmentSlug: z.string().min(1).describe(DYNAMIC_SECRETS.LIST.environmentSlug)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
dynamicSecrets: SanitizedDynamicSecretSchema.array()
|
||||
})
|
||||
@@ -308,7 +302,6 @@ export const registerDynamicSecretRouter = async (server: FastifyZodProvider) =>
|
||||
environmentSlug: z.string().min(1).describe(DYNAMIC_SECRETS.LIST_LEAES_BY_NAME.environmentSlug)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
leases: DynamicSecretLeasesSchema.array()
|
||||
})
|
||||
|
||||
@@ -4,7 +4,6 @@ import { z } from "zod";
|
||||
import { GroupsSchema, OrgMembershipRole, UsersSchema } from "@app/db/schemas";
|
||||
import { GROUPS } from "@app/lib/api-docs";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { DefaultResponseErrorsSchema } from "@app/server/routes/sanitizedSchemas";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
export const registerGroupRouter = async (server: FastifyZodProvider) => {
|
||||
@@ -27,7 +26,6 @@ export const registerGroupRouter = async (server: FastifyZodProvider) => {
|
||||
role: z.string().trim().min(1).default(OrgMembershipRole.NoAccess).describe(GROUPS.CREATE.role)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: GroupsSchema
|
||||
}
|
||||
},
|
||||
@@ -53,7 +51,6 @@ export const registerGroupRouter = async (server: FastifyZodProvider) => {
|
||||
id: z.string().trim().describe(GROUPS.GET_BY_ID.id)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: GroupsSchema
|
||||
}
|
||||
},
|
||||
@@ -76,7 +73,6 @@ export const registerGroupRouter = async (server: FastifyZodProvider) => {
|
||||
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||
schema: {
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: GroupsSchema.array()
|
||||
}
|
||||
},
|
||||
@@ -116,7 +112,6 @@ export const registerGroupRouter = async (server: FastifyZodProvider) => {
|
||||
})
|
||||
.partial(),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: GroupsSchema
|
||||
}
|
||||
},
|
||||
@@ -143,7 +138,6 @@ export const registerGroupRouter = async (server: FastifyZodProvider) => {
|
||||
id: z.string().trim().describe(GROUPS.DELETE.id)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: GroupsSchema
|
||||
}
|
||||
},
|
||||
@@ -174,7 +168,6 @@ export const registerGroupRouter = async (server: FastifyZodProvider) => {
|
||||
username: z.string().optional().describe(GROUPS.LIST_USERS.username)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
users: UsersSchema.pick({
|
||||
email: true,
|
||||
@@ -217,7 +210,6 @@ export const registerGroupRouter = async (server: FastifyZodProvider) => {
|
||||
username: z.string().trim().describe(GROUPS.ADD_USER.username)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: UsersSchema.pick({
|
||||
email: true,
|
||||
username: true,
|
||||
@@ -251,7 +243,6 @@ export const registerGroupRouter = async (server: FastifyZodProvider) => {
|
||||
username: z.string().trim().describe(GROUPS.DELETE_USER.username)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: UsersSchema.pick({
|
||||
email: true,
|
||||
username: true,
|
||||
|
||||
@@ -10,7 +10,6 @@ import { alphaNumericNanoId } from "@app/lib/nanoid";
|
||||
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import {
|
||||
DefaultResponseErrorsSchema,
|
||||
ProjectPermissionSchema,
|
||||
ProjectSpecificPrivilegePermissionSchema,
|
||||
SanitizedIdentityPrivilegeSchema
|
||||
@@ -53,7 +52,6 @@ export const registerIdentityProjectAdditionalPrivilegeRouter = async (server: F
|
||||
).optional()
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
privilege: SanitizedIdentityPrivilegeSchema
|
||||
})
|
||||
@@ -133,7 +131,6 @@ export const registerIdentityProjectAdditionalPrivilegeRouter = async (server: F
|
||||
.describe(IDENTITY_ADDITIONAL_PRIVILEGE.CREATE.temporaryAccessStartTime)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
privilege: SanitizedIdentityPrivilegeSchema
|
||||
})
|
||||
@@ -218,7 +215,6 @@ export const registerIdentityProjectAdditionalPrivilegeRouter = async (server: F
|
||||
.partial()
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
privilege: SanitizedIdentityPrivilegeSchema
|
||||
})
|
||||
@@ -274,7 +270,6 @@ export const registerIdentityProjectAdditionalPrivilegeRouter = async (server: F
|
||||
projectSlug: z.string().min(1).describe(IDENTITY_ADDITIONAL_PRIVILEGE.DELETE.projectSlug)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
privilege: SanitizedIdentityPrivilegeSchema
|
||||
})
|
||||
@@ -316,7 +311,6 @@ export const registerIdentityProjectAdditionalPrivilegeRouter = async (server: F
|
||||
projectSlug: z.string().min(1).describe(IDENTITY_ADDITIONAL_PRIVILEGE.GET_BY_SLUG.projectSlug)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
privilege: SanitizedIdentityPrivilegeSchema
|
||||
})
|
||||
@@ -354,7 +348,6 @@ export const registerIdentityProjectAdditionalPrivilegeRouter = async (server: F
|
||||
projectSlug: z.string().min(1).describe(IDENTITY_ADDITIONAL_PRIVILEGE.LIST.projectSlug)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
privileges: SanitizedIdentityPrivilegeSchema.array()
|
||||
})
|
||||
|
||||
@@ -6,11 +6,7 @@ import { ProjectMembershipRole, ProjectMembershipsSchema, ProjectRolesSchema } f
|
||||
import { PROJECT_ROLE } from "@app/lib/api-docs";
|
||||
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import {
|
||||
DefaultResponseErrorsSchema,
|
||||
ProjectPermissionSchema,
|
||||
SanitizedRoleSchema
|
||||
} from "@app/server/routes/sanitizedSchemas";
|
||||
import { ProjectPermissionSchema, SanitizedRoleSchema } from "@app/server/routes/sanitizedSchemas";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
export const registerProjectRoleRouter = async (server: FastifyZodProvider) => {
|
||||
@@ -49,7 +45,6 @@ export const registerProjectRoleRouter = async (server: FastifyZodProvider) => {
|
||||
permissions: ProjectPermissionSchema.array().describe(PROJECT_ROLE.CREATE.permissions)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
role: SanitizedRoleSchema
|
||||
})
|
||||
@@ -110,7 +105,6 @@ export const registerProjectRoleRouter = async (server: FastifyZodProvider) => {
|
||||
permissions: ProjectPermissionSchema.array().describe(PROJECT_ROLE.UPDATE.permissions).optional()
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
role: SanitizedRoleSchema
|
||||
})
|
||||
@@ -152,7 +146,6 @@ export const registerProjectRoleRouter = async (server: FastifyZodProvider) => {
|
||||
roleId: z.string().trim().describe(PROJECT_ROLE.DELETE.roleId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
role: SanitizedRoleSchema
|
||||
})
|
||||
@@ -189,7 +182,6 @@ export const registerProjectRoleRouter = async (server: FastifyZodProvider) => {
|
||||
projectSlug: z.string().trim().describe(PROJECT_ROLE.LIST.projectSlug)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
roles: ProjectRolesSchema.omit({ permissions: true }).array()
|
||||
})
|
||||
@@ -220,7 +212,6 @@ export const registerProjectRoleRouter = async (server: FastifyZodProvider) => {
|
||||
slug: z.string().trim().describe(PROJECT_ROLE.GET_ROLE_BY_SLUG.roleSlug)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
role: SanitizedRoleSchema
|
||||
})
|
||||
@@ -251,7 +242,6 @@ export const registerProjectRoleRouter = async (server: FastifyZodProvider) => {
|
||||
projectId: z.string().trim()
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
data: z.object({
|
||||
membership: ProjectMembershipsSchema.extend({
|
||||
|
||||
@@ -6,7 +6,6 @@ import { AUDIT_LOGS, PROJECTS } from "@app/lib/api-docs";
|
||||
import { getLastMidnightDateISO, removeTrailingSlash } from "@app/lib/fn";
|
||||
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { DefaultResponseErrorsSchema } from "@app/server/routes/sanitizedSchemas";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import { KmsType } from "@app/services/kms/kms-types";
|
||||
|
||||
@@ -34,7 +33,6 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
||||
limit: z.coerce.number().default(20).describe(PROJECTS.GET_SNAPSHOTS.limit)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
secretSnapshots: SecretSnapshotsSchema.array()
|
||||
})
|
||||
|
||||
@@ -4,7 +4,7 @@ import { SecretSnapshotsSchema, SecretTagsSchema } from "@app/db/schemas";
|
||||
import { PROJECTS } from "@app/lib/api-docs";
|
||||
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { DefaultResponseErrorsSchema, secretRawSchema } from "@app/server/routes/sanitizedSchemas";
|
||||
import { secretRawSchema } from "@app/server/routes/sanitizedSchemas";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
export const registerSnapshotRouter = async (server: FastifyZodProvider) => {
|
||||
@@ -77,7 +77,6 @@ export const registerSnapshotRouter = async (server: FastifyZodProvider) => {
|
||||
secretSnapshotId: z.string().trim().describe(PROJECTS.ROLLBACK_TO_SNAPSHOT.secretSnapshotId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
secretSnapshot: SecretSnapshotsSchema
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user