mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 04:14:38 +00:00
requested changes
This commit is contained in:
@@ -15,8 +15,6 @@ import {
|
||||
validateCaDateField
|
||||
} from "@app/services/certificate-authority/certificate-authority-validators";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
method: "POST",
|
||||
@@ -65,7 +63,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
}
|
||||
),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
ca: CertificateAuthoritiesSchema
|
||||
})
|
||||
@@ -111,7 +108,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
caId: z.string().trim().describe(CERTIFICATE_AUTHORITIES.GET.caId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
ca: CertificateAuthoritiesSchema
|
||||
})
|
||||
@@ -159,7 +155,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
caCertId: z.string().trim().describe(CERTIFICATE_AUTHORITIES.GET_CERT_BY_ID.caCertId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.instanceof(Buffer)
|
||||
}
|
||||
},
|
||||
@@ -192,7 +187,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
.describe(CERTIFICATE_AUTHORITIES.CREATE.requireTemplateForIssuance)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
ca: CertificateAuthoritiesSchema
|
||||
})
|
||||
@@ -240,7 +234,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
caId: z.string().trim().describe(CERTIFICATE_AUTHORITIES.DELETE.caId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
ca: CertificateAuthoritiesSchema
|
||||
})
|
||||
@@ -286,7 +279,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
caId: z.string().trim().describe(CERTIFICATE_AUTHORITIES.GET_CSR.caId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
csr: z.string().describe(CERTIFICATE_AUTHORITIES.GET_CSR.csr)
|
||||
})
|
||||
@@ -336,7 +328,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
notAfter: validateCaDateField.describe(CERTIFICATE_AUTHORITIES.RENEW_CA_CERT.notAfter)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
certificate: z.string().trim().describe(CERTIFICATE_AUTHORITIES.RENEW_CA_CERT.certificate),
|
||||
certificateChain: z.string().trim().describe(CERTIFICATE_AUTHORITIES.RENEW_CA_CERT.certificateChain),
|
||||
@@ -388,7 +379,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
caId: z.string().trim().describe(CERTIFICATE_AUTHORITIES.GET_CA_CERTS.caId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.array(
|
||||
z.object({
|
||||
certificate: z.string().describe(CERTIFICATE_AUTHORITIES.GET_CA_CERTS.certificate),
|
||||
@@ -437,7 +427,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
caId: z.string().trim().describe(CERTIFICATE_AUTHORITIES.GET_CERT.caId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
certificate: z.string().describe(CERTIFICATE_AUTHORITIES.GET_CERT.certificate),
|
||||
certificateChain: z.string().describe(CERTIFICATE_AUTHORITIES.GET_CERT.certificateChain),
|
||||
@@ -493,7 +482,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
maxPathLength: z.number().min(-1).default(-1).describe(CERTIFICATE_AUTHORITIES.SIGN_INTERMEDIATE.maxPathLength)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
certificate: z.string().trim().describe(CERTIFICATE_AUTHORITIES.SIGN_INTERMEDIATE.certificate),
|
||||
certificateChain: z.string().trim().describe(CERTIFICATE_AUTHORITIES.SIGN_INTERMEDIATE.certificateChain),
|
||||
@@ -555,7 +543,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
certificateChain: z.string().trim().describe(CERTIFICATE_AUTHORITIES.IMPORT_CERT.certificateChain)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
message: z.string().trim(),
|
||||
caId: z.string().trim()
|
||||
@@ -629,7 +616,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
}
|
||||
),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
certificate: z.string().trim().describe(CERTIFICATE_AUTHORITIES.ISSUE_CERT.certificate),
|
||||
issuingCaCertificate: z.string().trim().describe(CERTIFICATE_AUTHORITIES.ISSUE_CERT.issuingCaCertificate),
|
||||
@@ -712,7 +698,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
}
|
||||
),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
certificate: z.string().trim().describe(CERTIFICATE_AUTHORITIES.SIGN_CERT.certificate),
|
||||
issuingCaCertificate: z.string().trim().describe(CERTIFICATE_AUTHORITIES.ISSUE_CERT.issuingCaCertificate),
|
||||
@@ -768,7 +753,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
caId: z.string().trim().describe(CERTIFICATE_AUTHORITIES.SIGN_CERT.caId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
certificateTemplates: CertificateTemplatesSchema.array()
|
||||
})
|
||||
@@ -814,7 +798,6 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
||||
caId: z.string().trim().describe(CERTIFICATE_AUTHORITIES.GET_CRLS.caId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.array(
|
||||
z.object({
|
||||
id: z.string().describe(CERTIFICATE_AUTHORITIES.GET_CRLS.id),
|
||||
|
||||
@@ -13,8 +13,6 @@ import {
|
||||
validateCaDateField
|
||||
} from "@app/services/certificate-authority/certificate-authority-validators";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerCertRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
method: "GET",
|
||||
@@ -29,7 +27,6 @@ export const registerCertRouter = async (server: FastifyZodProvider) => {
|
||||
serialNumber: z.string().trim().describe(CERTIFICATES.GET.serialNumber)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
certificate: CertificatesSchema
|
||||
})
|
||||
@@ -121,7 +118,6 @@ export const registerCertRouter = async (server: FastifyZodProvider) => {
|
||||
}
|
||||
),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
certificate: z.string().trim().describe(CERTIFICATE_AUTHORITIES.ISSUE_CERT.certificate),
|
||||
issuingCaCertificate: z.string().trim().describe(CERTIFICATE_AUTHORITIES.ISSUE_CERT.issuingCaCertificate),
|
||||
@@ -223,7 +219,6 @@ export const registerCertRouter = async (server: FastifyZodProvider) => {
|
||||
}
|
||||
),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
certificate: z.string().trim().describe(CERTIFICATE_AUTHORITIES.SIGN_CERT.certificate),
|
||||
issuingCaCertificate: z.string().trim().describe(CERTIFICATE_AUTHORITIES.ISSUE_CERT.issuingCaCertificate),
|
||||
@@ -281,7 +276,6 @@ export const registerCertRouter = async (server: FastifyZodProvider) => {
|
||||
revocationReason: z.nativeEnum(CrlReason).describe(CERTIFICATES.REVOKE.revocationReason)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
message: z.string().trim(),
|
||||
serialNumber: z.string().trim().describe(CERTIFICATES.REVOKE.serialNumberRes),
|
||||
@@ -333,7 +327,6 @@ export const registerCertRouter = async (server: FastifyZodProvider) => {
|
||||
serialNumber: z.string().trim().describe(CERTIFICATES.DELETE.serialNumber)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
certificate: CertificatesSchema
|
||||
})
|
||||
@@ -380,7 +373,6 @@ export const registerCertRouter = async (server: FastifyZodProvider) => {
|
||||
serialNumber: z.string().trim().describe(CERTIFICATES.GET_CERT.serialNumber)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
certificate: z.string().trim().describe(CERTIFICATES.GET_CERT.certificate),
|
||||
certificateChain: z.string().trim().describe(CERTIFICATES.GET_CERT.certificateChain),
|
||||
|
||||
@@ -11,8 +11,6 @@ import { CertExtendedKeyUsage, CertKeyUsage } from "@app/services/certificate/ce
|
||||
import { sanitizedCertificateTemplate } from "@app/services/certificate-template/certificate-template-schema";
|
||||
import { validateTemplateRegexField } from "@app/services/certificate-template/certificate-template-validators";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
const sanitizedEstConfig = CertificateTemplateEstConfigsSchema.pick({
|
||||
id: true,
|
||||
certificateTemplateId: true,
|
||||
@@ -31,7 +29,6 @@ export const registerCertificateTemplateRouter = async (server: FastifyZodProvid
|
||||
certificateTemplateId: z.string().describe(CERTIFICATE_TEMPLATES.GET.certificateTemplateId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: sanitizedCertificateTemplate
|
||||
}
|
||||
},
|
||||
@@ -93,7 +90,6 @@ export const registerCertificateTemplateRouter = async (server: FastifyZodProvid
|
||||
.describe(CERTIFICATE_TEMPLATES.CREATE.extendedKeyUsages)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: sanitizedCertificateTemplate
|
||||
}
|
||||
},
|
||||
@@ -159,7 +155,6 @@ export const registerCertificateTemplateRouter = async (server: FastifyZodProvid
|
||||
certificateTemplateId: z.string().describe(CERTIFICATE_TEMPLATES.UPDATE.certificateTemplateId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: sanitizedCertificateTemplate
|
||||
}
|
||||
},
|
||||
@@ -206,7 +201,6 @@ export const registerCertificateTemplateRouter = async (server: FastifyZodProvid
|
||||
certificateTemplateId: z.string().describe(CERTIFICATE_TEMPLATES.DELETE.certificateTemplateId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: sanitizedCertificateTemplate
|
||||
}
|
||||
},
|
||||
@@ -253,7 +247,6 @@ export const registerCertificateTemplateRouter = async (server: FastifyZodProvid
|
||||
isEnabled: z.boolean().default(true)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: sanitizedEstConfig
|
||||
}
|
||||
},
|
||||
@@ -301,7 +294,6 @@ export const registerCertificateTemplateRouter = async (server: FastifyZodProvid
|
||||
isEnabled: z.boolean().optional()
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: sanitizedEstConfig
|
||||
}
|
||||
},
|
||||
@@ -344,7 +336,6 @@ export const registerCertificateTemplateRouter = async (server: FastifyZodProvid
|
||||
certificateTemplateId: z.string().trim()
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: sanitizedEstConfig.extend({
|
||||
caChain: z.string()
|
||||
})
|
||||
|
||||
@@ -12,8 +12,6 @@ import {
|
||||
validatePrincipalArns
|
||||
} from "@app/services/identity-aws-auth/identity-aws-auth-validators";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
method: "POST",
|
||||
@@ -30,7 +28,6 @@ export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider)
|
||||
iamRequestHeaders: z.string().describe(AWS_AUTH.LOGIN.iamRequestHeaders)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
accessToken: z.string(),
|
||||
expiresIn: z.coerce.number(),
|
||||
@@ -121,7 +118,6 @@ export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider)
|
||||
accessTokenNumUsesLimit: z.number().int().min(0).default(0).describe(AWS_AUTH.ATTACH.accessTokenNumUsesLimit)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityAwsAuth: IdentityAwsAuthsSchema
|
||||
})
|
||||
@@ -201,7 +197,6 @@ export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider)
|
||||
.describe(AWS_AUTH.UPDATE.accessTokenMaxTTL)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityAwsAuth: IdentityAwsAuthsSchema
|
||||
})
|
||||
@@ -257,7 +252,6 @@ export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider)
|
||||
identityId: z.string().describe(AWS_AUTH.RETRIEVE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityAwsAuth: IdentityAwsAuthsSchema
|
||||
})
|
||||
@@ -304,7 +298,6 @@ export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider)
|
||||
identityId: z.string().describe(AWS_AUTH.REVOKE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityAwsAuth: IdentityAwsAuthsSchema
|
||||
})
|
||||
|
||||
@@ -9,7 +9,7 @@ import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import { TIdentityTrustedIp } from "@app/services/identity/identity-types";
|
||||
import { validateAzureAuthField } from "@app/services/identity-azure-auth/identity-azure-auth-validators";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
import {} from "../sanitizedSchemas";
|
||||
|
||||
export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
@@ -25,7 +25,6 @@ export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvider
|
||||
jwt: z.string()
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
accessToken: z.string(),
|
||||
expiresIn: z.coerce.number(),
|
||||
@@ -111,7 +110,6 @@ export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvider
|
||||
accessTokenNumUsesLimit: z.number().int().min(0).default(0).describe(AZURE_AUTH.ATTACH.accessTokenNumUsesLimit)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityAzureAuth: IdentityAzureAuthsSchema
|
||||
})
|
||||
@@ -192,7 +190,6 @@ export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvider
|
||||
.describe(AZURE_AUTH.UPDATE.accessTokenMaxTTL)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityAzureAuth: IdentityAzureAuthsSchema
|
||||
})
|
||||
@@ -247,7 +244,6 @@ export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvider
|
||||
identityId: z.string().describe(AZURE_AUTH.RETRIEVE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityAzureAuth: IdentityAzureAuthsSchema
|
||||
})
|
||||
@@ -295,7 +291,6 @@ export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvider
|
||||
identityId: z.string().describe(AZURE_AUTH.REVOKE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityAzureAuth: IdentityAzureAuthsSchema
|
||||
})
|
||||
|
||||
@@ -9,8 +9,6 @@ import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import { TIdentityTrustedIp } from "@app/services/identity/identity-types";
|
||||
import { validateGcpAuthField } from "@app/services/identity-gcp-auth/identity-gcp-auth-validators";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
method: "POST",
|
||||
@@ -25,7 +23,6 @@ export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider)
|
||||
jwt: z.string()
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
accessToken: z.string(),
|
||||
expiresIn: z.coerce.number(),
|
||||
@@ -112,7 +109,6 @@ export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider)
|
||||
accessTokenNumUsesLimit: z.number().int().min(0).default(0).describe(GCP_AUTH.ATTACH.accessTokenNumUsesLimit)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityGcpAuth: IdentityGcpAuthsSchema
|
||||
})
|
||||
@@ -194,7 +190,6 @@ export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider)
|
||||
.describe(GCP_AUTH.UPDATE.accessTokenMaxTTL)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityGcpAuth: IdentityGcpAuthsSchema
|
||||
})
|
||||
@@ -251,7 +246,6 @@ export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider)
|
||||
identityId: z.string().describe(GCP_AUTH.RETRIEVE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityGcpAuth: IdentityGcpAuthsSchema
|
||||
})
|
||||
@@ -299,7 +293,6 @@ export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider)
|
||||
identityId: z.string().describe(GCP_AUTH.REVOKE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityGcpAuth: IdentityGcpAuthsSchema
|
||||
})
|
||||
|
||||
@@ -8,8 +8,6 @@ import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import { TIdentityTrustedIp } from "@app/services/identity/identity-types";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
const IdentityKubernetesAuthResponseSchema = IdentityKubernetesAuthsSchema.omit({
|
||||
encryptedCaCert: true,
|
||||
caCertIV: true,
|
||||
@@ -36,7 +34,6 @@ export const registerIdentityKubernetesRouter = async (server: FastifyZodProvide
|
||||
jwt: z.string().trim()
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
accessToken: z.string(),
|
||||
expiresIn: z.coerce.number(),
|
||||
@@ -132,7 +129,6 @@ export const registerIdentityKubernetesRouter = async (server: FastifyZodProvide
|
||||
.describe(KUBERNETES_AUTH.ATTACH.accessTokenNumUsesLimit)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityKubernetesAuth: IdentityKubernetesAuthResponseSchema
|
||||
})
|
||||
@@ -226,7 +222,6 @@ export const registerIdentityKubernetesRouter = async (server: FastifyZodProvide
|
||||
.describe(KUBERNETES_AUTH.UPDATE.accessTokenMaxTTL)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityKubernetesAuth: IdentityKubernetesAuthResponseSchema
|
||||
})
|
||||
@@ -282,7 +277,6 @@ export const registerIdentityKubernetesRouter = async (server: FastifyZodProvide
|
||||
identityId: z.string().describe(KUBERNETES_AUTH.RETRIEVE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityKubernetesAuth: IdentityKubernetesAuthResponseSchema
|
||||
})
|
||||
@@ -330,7 +324,6 @@ export const registerIdentityKubernetesRouter = async (server: FastifyZodProvide
|
||||
identityId: z.string().describe(KUBERNETES_AUTH.REVOKE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityKubernetesAuth: IdentityKubernetesAuthResponseSchema.omit({
|
||||
caCert: true,
|
||||
|
||||
@@ -12,8 +12,6 @@ import {
|
||||
validateOidcBoundClaimsField
|
||||
} from "@app/services/identity-oidc-auth/identity-oidc-auth-validators";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
const IdentityOidcAuthResponseSchema = IdentityOidcAuthsSchema.omit({
|
||||
encryptedCaCert: true,
|
||||
caCertIV: true,
|
||||
@@ -36,7 +34,6 @@ export const registerIdentityOidcAuthRouter = async (server: FastifyZodProvider)
|
||||
jwt: z.string().trim()
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
accessToken: z.string(),
|
||||
expiresIn: z.coerce.number(),
|
||||
@@ -127,7 +124,6 @@ export const registerIdentityOidcAuthRouter = async (server: FastifyZodProvider)
|
||||
accessTokenNumUsesLimit: z.number().int().min(0).default(0).describe(OIDC_AUTH.ATTACH.accessTokenNumUsesLimit)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityOidcAuth: IdentityOidcAuthResponseSchema
|
||||
})
|
||||
@@ -227,7 +223,6 @@ export const registerIdentityOidcAuthRouter = async (server: FastifyZodProvider)
|
||||
})
|
||||
.partial(),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityOidcAuth: IdentityOidcAuthResponseSchema
|
||||
})
|
||||
@@ -286,7 +281,6 @@ export const registerIdentityOidcAuthRouter = async (server: FastifyZodProvider)
|
||||
identityId: z.string().describe(OIDC_AUTH.RETRIEVE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityOidcAuth: IdentityOidcAuthResponseSchema
|
||||
})
|
||||
@@ -334,7 +328,6 @@ export const registerIdentityOidcAuthRouter = async (server: FastifyZodProvider)
|
||||
identityId: z.string().describe(OIDC_AUTH.REVOKE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityOidcAuth: IdentityOidcAuthResponseSchema.omit({
|
||||
caCert: true
|
||||
|
||||
@@ -9,7 +9,7 @@ import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import { PostHogEventTypes } from "@app/services/telemetry/telemetry-types";
|
||||
|
||||
import { DefaultResponseErrorsSchema, SanitizedProjectSchema } from "../sanitizedSchemas";
|
||||
import { SanitizedProjectSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
@@ -32,7 +32,6 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
role: z.string().trim().min(1).default(OrgMembershipRole.NoAccess).describe(IDENTITIES.CREATE.role)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identity: IdentitiesSchema
|
||||
})
|
||||
@@ -97,7 +96,6 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
role: z.string().trim().min(1).optional().describe(IDENTITIES.UPDATE.role)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identity: IdentitiesSchema
|
||||
})
|
||||
@@ -147,7 +145,6 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
identityId: z.string().describe(IDENTITIES.DELETE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identity: IdentitiesSchema
|
||||
})
|
||||
@@ -194,7 +191,6 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
identityId: z.string().describe(IDENTITIES.GET_BY_ID.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identity: IdentityOrgMembershipsSchema.extend({
|
||||
customRole: OrgRolesSchema.pick({
|
||||
@@ -240,7 +236,6 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
orgId: z.string().describe(IDENTITIES.LIST.orgId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identities: IdentityOrgMembershipsSchema.extend({
|
||||
customRole: OrgRolesSchema.pick({
|
||||
|
||||
@@ -8,8 +8,6 @@ import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import { TIdentityTrustedIp } from "@app/services/identity/identity-types";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
method: "POST",
|
||||
@@ -59,7 +57,6 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
accessTokenNumUsesLimit: z.number().int().min(0).default(0).describe(TOKEN_AUTH.ATTACH.accessTokenNumUsesLimit)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityTokenAuth: IdentityTokenAuthsSchema
|
||||
})
|
||||
@@ -135,7 +132,6 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
.describe(TOKEN_AUTH.UPDATE.accessTokenMaxTTL)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityTokenAuth: IdentityTokenAuthsSchema
|
||||
})
|
||||
@@ -190,7 +186,6 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
identityId: z.string().describe(TOKEN_AUTH.RETRIEVE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityTokenAuth: IdentityTokenAuthsSchema
|
||||
})
|
||||
@@ -238,7 +233,6 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
identityId: z.string().describe(TOKEN_AUTH.REVOKE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityTokenAuth: IdentityTokenAuthsSchema
|
||||
})
|
||||
@@ -289,7 +283,6 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
name: z.string().optional().describe(TOKEN_AUTH.CREATE_TOKEN.name)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
accessToken: z.string(),
|
||||
expiresIn: z.coerce.number(),
|
||||
@@ -352,7 +345,6 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
limit: z.coerce.number().min(1).max(100).default(20).describe(TOKEN_AUTH.GET_TOKENS.limit)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
tokens: IdentityAccessTokensSchema.array()
|
||||
})
|
||||
@@ -404,7 +396,6 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
name: z.string().optional().describe(TOKEN_AUTH.UPDATE_TOKEN.name)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
token: IdentityAccessTokensSchema
|
||||
})
|
||||
@@ -455,7 +446,6 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
tokenId: z.string().describe(TOKEN_AUTH.REVOKE_TOKEN.tokenId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
message: z.string()
|
||||
})
|
||||
|
||||
@@ -8,8 +8,6 @@ import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import { TIdentityTrustedIp } from "@app/services/identity/identity-types";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const sanitizedClientSecretSchema = IdentityUaClientSecretsSchema.pick({
|
||||
id: true,
|
||||
createdAt: true,
|
||||
@@ -37,7 +35,6 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
clientSecret: z.string().trim().describe(UNIVERSAL_AUTH.LOGIN.clientSecret)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
accessToken: z.string(),
|
||||
expiresIn: z.coerce.number(),
|
||||
@@ -133,7 +130,6 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
.describe(UNIVERSAL_AUTH.ATTACH.accessTokenNumUsesLimit)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityUniversalAuth: IdentityUniversalAuthsSchema
|
||||
})
|
||||
@@ -226,7 +222,6 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
.describe(UNIVERSAL_AUTH.UPDATE.accessTokenMaxTTL)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityUniversalAuth: IdentityUniversalAuthsSchema
|
||||
})
|
||||
@@ -280,7 +275,6 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
identityId: z.string().describe(UNIVERSAL_AUTH.RETRIEVE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityUniversalAuth: IdentityUniversalAuthsSchema
|
||||
})
|
||||
@@ -328,7 +322,6 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
identityId: z.string().describe(UNIVERSAL_AUTH.REVOKE.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
identityUniversalAuth: IdentityUniversalAuthsSchema
|
||||
})
|
||||
@@ -381,7 +374,6 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
ttl: z.number().min(0).max(315360000).default(0).describe(UNIVERSAL_AUTH.CREATE_CLIENT_SECRET.ttl)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
clientSecret: z.string(),
|
||||
clientSecretData: sanitizedClientSecretSchema
|
||||
@@ -433,7 +425,6 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
identityId: z.string().describe(UNIVERSAL_AUTH.LIST_CLIENT_SECRETS.identityId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
clientSecretData: sanitizedClientSecretSchema.array()
|
||||
})
|
||||
@@ -483,7 +474,6 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
clientSecretId: z.string().describe(UNIVERSAL_AUTH.GET_CLIENT_SECRET.clientSecretId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
clientSecretData: sanitizedClientSecretSchema
|
||||
})
|
||||
@@ -534,7 +524,6 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
clientSecretId: z.string().describe(UNIVERSAL_AUTH.REVOKE_CLIENT_SECRET.clientSecretId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
clientSecretData: sanitizedClientSecretSchema
|
||||
})
|
||||
|
||||
@@ -6,7 +6,7 @@ import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
import { DefaultResponseErrorsSchema, integrationAuthPubSchema } from "../sanitizedSchemas";
|
||||
import { integrationAuthPubSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerIntegrationAuthRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
@@ -64,7 +64,6 @@ export const registerIntegrationAuthRouter = async (server: FastifyZodProvider)
|
||||
integrationAuthId: z.string().trim().describe(INTEGRATION_AUTH.GET.integrationAuthId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
integrationAuth: integrationAuthPubSchema
|
||||
})
|
||||
@@ -101,7 +100,6 @@ export const registerIntegrationAuthRouter = async (server: FastifyZodProvider)
|
||||
projectId: z.string().trim().describe(INTEGRATION_AUTH.DELETE.projectId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
integrationAuth: integrationAuthPubSchema.array()
|
||||
})
|
||||
@@ -150,7 +148,6 @@ export const registerIntegrationAuthRouter = async (server: FastifyZodProvider)
|
||||
integrationAuthId: z.string().trim().describe(INTEGRATION_AUTH.DELETE_BY_ID.integrationAuthId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
integrationAuth: integrationAuthPubSchema
|
||||
})
|
||||
@@ -254,7 +251,6 @@ export const registerIntegrationAuthRouter = async (server: FastifyZodProvider)
|
||||
refreshToken: z.string().trim().optional().describe(INTEGRATION_AUTH.CREATE_ACCESS_TOKEN.refreshToken)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
integrationAuth: integrationAuthPubSchema
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@ import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import { IntegrationMetadataSchema } from "@app/services/integration/integration-schema";
|
||||
import { PostHogEventTypes, TIntegrationCreatedEvent } from "@app/services/telemetry/telemetry-types";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
import {} from "../sanitizedSchemas";
|
||||
|
||||
export const registerIntegrationRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
@@ -51,7 +51,6 @@ export const registerIntegrationRouter = async (server: FastifyZodProvider) => {
|
||||
metadata: IntegrationMetadataSchema.default({})
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
integration: IntegrationsSchema
|
||||
})
|
||||
@@ -138,7 +137,6 @@ export const registerIntegrationRouter = async (server: FastifyZodProvider) => {
|
||||
metadata: IntegrationMetadataSchema.optional()
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
integration: IntegrationsSchema
|
||||
})
|
||||
@@ -223,7 +221,6 @@ export const registerIntegrationRouter = async (server: FastifyZodProvider) => {
|
||||
.transform((val) => val === "true")
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
integration: IntegrationsSchema
|
||||
})
|
||||
|
||||
@@ -18,8 +18,6 @@ import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { ActorType, AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerOrgRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
method: "GET",
|
||||
@@ -116,7 +114,6 @@ export const registerOrgRouter = async (server: FastifyZodProvider) => {
|
||||
}),
|
||||
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
auditLogs: AuditLogsSchema.omit({
|
||||
eventMetadata: true,
|
||||
|
||||
@@ -7,8 +7,6 @@ import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerPkiAlertRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
method: "POST",
|
||||
@@ -31,7 +29,6 @@ export const registerPkiAlertRouter = async (server: FastifyZodProvider) => {
|
||||
.describe(ALERTS.CREATE.emails)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: PkiAlertsSchema
|
||||
}
|
||||
},
|
||||
@@ -76,7 +73,6 @@ export const registerPkiAlertRouter = async (server: FastifyZodProvider) => {
|
||||
alertId: z.string().trim().describe(ALERTS.GET.alertId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: PkiAlertsSchema
|
||||
}
|
||||
},
|
||||
@@ -128,7 +124,6 @@ export const registerPkiAlertRouter = async (server: FastifyZodProvider) => {
|
||||
.describe(ALERTS.UPDATE.emails)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: PkiAlertsSchema
|
||||
}
|
||||
},
|
||||
@@ -174,7 +169,6 @@ export const registerPkiAlertRouter = async (server: FastifyZodProvider) => {
|
||||
alertId: z.string().trim().describe(ALERTS.DELETE.alertId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: PkiAlertsSchema
|
||||
}
|
||||
},
|
||||
|
||||
@@ -8,8 +8,6 @@ import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import { PkiItemType } from "@app/services/pki-collection/pki-collection-types";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerPkiCollectionRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
method: "POST",
|
||||
@@ -26,7 +24,6 @@ export const registerPkiCollectionRouter = async (server: FastifyZodProvider) =>
|
||||
description: z.string().trim().default("").describe(PKI_COLLECTIONS.CREATE.description)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: PkiCollectionsSchema
|
||||
}
|
||||
},
|
||||
@@ -68,7 +65,6 @@ export const registerPkiCollectionRouter = async (server: FastifyZodProvider) =>
|
||||
collectionId: z.string().trim().describe(PKI_COLLECTIONS.GET.collectionId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: PkiCollectionsSchema
|
||||
}
|
||||
},
|
||||
@@ -113,7 +109,6 @@ export const registerPkiCollectionRouter = async (server: FastifyZodProvider) =>
|
||||
description: z.string().trim().optional().describe(PKI_COLLECTIONS.UPDATE.description)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: PkiCollectionsSchema
|
||||
}
|
||||
},
|
||||
@@ -156,7 +151,6 @@ export const registerPkiCollectionRouter = async (server: FastifyZodProvider) =>
|
||||
collectionId: z.string().trim().describe(PKI_COLLECTIONS.DELETE.collectionId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: PkiCollectionsSchema
|
||||
}
|
||||
},
|
||||
@@ -202,7 +196,6 @@ export const registerPkiCollectionRouter = async (server: FastifyZodProvider) =>
|
||||
limit: z.coerce.number().min(1).max(100).default(25).describe(PKI_COLLECTIONS.LIST_ITEMS.limit)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
collectionItems: z.array(
|
||||
PkiCollectionItemsSchema.omit({ caId: true, certId: true }).extend({
|
||||
@@ -263,7 +256,6 @@ export const registerPkiCollectionRouter = async (server: FastifyZodProvider) =>
|
||||
itemId: z.string().trim().describe(PKI_COLLECTIONS.ADD_ITEM.itemId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: PkiCollectionItemsSchema.omit({ caId: true, certId: true }).extend({
|
||||
type: z.nativeEnum(PkiItemType).describe(PKI_COLLECTIONS.ADD_ITEM.type),
|
||||
itemId: z.string().trim().describe(PKI_COLLECTIONS.ADD_ITEM.itemId)
|
||||
@@ -312,7 +304,6 @@ export const registerPkiCollectionRouter = async (server: FastifyZodProvider) =>
|
||||
collectionItemId: z.string().trim().describe(PKI_COLLECTIONS.DELETE_ITEM.collectionItemId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: PkiCollectionItemsSchema.omit({ caId: true, certId: true }).extend({
|
||||
type: z.nativeEnum(PkiItemType).describe(PKI_COLLECTIONS.DELETE_ITEM.type),
|
||||
itemId: z.string().trim().describe(PKI_COLLECTIONS.DELETE_ITEM.itemId)
|
||||
|
||||
@@ -8,8 +8,6 @@ import { writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerProjectEnvRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
method: "GET",
|
||||
@@ -87,7 +85,6 @@ export const registerProjectEnvRouter = async (server: FastifyZodProvider) => {
|
||||
.describe(ENVIRONMENTS.CREATE.slug)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
message: z.string(),
|
||||
workspace: z.string(),
|
||||
@@ -155,7 +152,6 @@ export const registerProjectEnvRouter = async (server: FastifyZodProvider) => {
|
||||
position: z.number().optional().describe(ENVIRONMENTS.UPDATE.position)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
message: z.string(),
|
||||
workspace: z.string(),
|
||||
@@ -217,7 +213,6 @@ export const registerProjectEnvRouter = async (server: FastifyZodProvider) => {
|
||||
id: z.string().trim().describe(ENVIRONMENTS.DELETE.id)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
message: z.string(),
|
||||
workspace: z.string(),
|
||||
|
||||
@@ -15,8 +15,6 @@ import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import { ProjectUserMembershipTemporaryMode } from "@app/services/project-membership/project-membership-types";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerProjectMembershipRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
method: "GET",
|
||||
@@ -35,7 +33,6 @@ export const registerProjectMembershipRouter = async (server: FastifyZodProvider
|
||||
workspaceId: z.string().trim().describe(PROJECT_USERS.GET_USER_MEMBERSHIPS.workspaceId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
memberships: ProjectMembershipsSchema.extend({
|
||||
user: UsersSchema.pick({
|
||||
@@ -97,7 +94,6 @@ export const registerProjectMembershipRouter = async (server: FastifyZodProvider
|
||||
username: z.string().min(1).trim().describe(PROJECT_USERS.GET_USER_MEMBERSHIP.username)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
membership: ProjectMembershipsSchema.extend({
|
||||
user: UsersSchema.pick({
|
||||
@@ -231,7 +227,6 @@ export const registerProjectMembershipRouter = async (server: FastifyZodProvider
|
||||
.describe(PROJECT_USERS.UPDATE_USER_MEMBERSHIP.roles)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
roles: ProjectUserMembershipRolesSchema.array()
|
||||
})
|
||||
|
||||
@@ -16,7 +16,7 @@ import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import { ProjectFilterType } from "@app/services/project/project-types";
|
||||
import { validateSlackChannelsField } from "@app/services/slack/slack-auth-validators";
|
||||
|
||||
import { DefaultResponseErrorsSchema, integrationAuthPubSchema, SanitizedProjectSchema } from "../sanitizedSchemas";
|
||||
import { integrationAuthPubSchema, SanitizedProjectSchema } from "../sanitizedSchemas";
|
||||
import { sanitizedServiceTokenSchema } from "../v2/service-token-router";
|
||||
|
||||
const projectWithEnv = SanitizedProjectSchema.merge(
|
||||
@@ -177,7 +177,6 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
||||
workspaceId: z.string().trim().describe(PROJECTS.GET.workspaceId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
workspace: projectWithEnv.optional()
|
||||
})
|
||||
@@ -300,7 +299,6 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
||||
autoCapitalization: z.boolean().optional().describe(PROJECTS.UPDATE.autoCapitalization)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
workspace: SanitizedProjectSchema
|
||||
})
|
||||
@@ -458,7 +456,6 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
||||
workspaceId: z.string().trim().describe(PROJECTS.LIST_INTEGRATION.workspaceId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
integrations: IntegrationsSchema.merge(
|
||||
z.object({
|
||||
@@ -502,7 +499,6 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
||||
workspaceId: z.string().trim().describe(PROJECTS.LIST_INTEGRATION_AUTHORIZATION.workspaceId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
authorizations: integrationAuthPubSchema.array()
|
||||
})
|
||||
|
||||
@@ -8,8 +8,6 @@ import { readLimit, secretsLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerSecretFolderRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
url: "/",
|
||||
@@ -45,7 +43,6 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
|
||||
.describe(FOLDERS.CREATE.directory)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
folder: SecretFoldersSchema
|
||||
})
|
||||
@@ -118,7 +115,6 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
|
||||
.describe(FOLDERS.UPDATE.directory)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
folder: SecretFoldersSchema
|
||||
})
|
||||
@@ -262,7 +258,6 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
|
||||
.describe(FOLDERS.DELETE.directory)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
folder: SecretFoldersSchema
|
||||
})
|
||||
@@ -331,7 +326,6 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
|
||||
.describe(FOLDERS.LIST.directory)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
folders: SecretFoldersSchema.array()
|
||||
})
|
||||
@@ -370,7 +364,6 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
|
||||
id: z.string().trim().describe(FOLDERS.GET_BY_ID.folderId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
folder: SecretFoldersSchema
|
||||
})
|
||||
|
||||
@@ -8,7 +8,7 @@ import { readLimit, secretsLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
import { DefaultResponseErrorsSchema, secretRawSchema } from "../sanitizedSchemas";
|
||||
import { secretRawSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerSecretImportRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
@@ -35,7 +35,6 @@ export const registerSecretImportRouter = async (server: FastifyZodProvider) =>
|
||||
isReplication: z.boolean().default(false).describe(SECRET_IMPORTS.CREATE.isReplication)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
message: z.string(),
|
||||
secretImport: SecretImportsSchema.omit({ importEnv: true }).merge(
|
||||
@@ -109,7 +108,6 @@ export const registerSecretImportRouter = async (server: FastifyZodProvider) =>
|
||||
})
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
message: z.string(),
|
||||
secretImport: SecretImportsSchema.omit({ importEnv: true }).merge(
|
||||
@@ -174,7 +172,6 @@ export const registerSecretImportRouter = async (server: FastifyZodProvider) =>
|
||||
path: z.string().trim().default("/").transform(removeTrailingSlash).describe(SECRET_IMPORTS.DELETE.path)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
message: z.string(),
|
||||
secretImport: SecretImportsSchema.omit({ importEnv: true }).merge(
|
||||
@@ -278,7 +275,6 @@ export const registerSecretImportRouter = async (server: FastifyZodProvider) =>
|
||||
path: z.string().trim().default("/").transform(removeTrailingSlash).describe(SECRET_IMPORTS.LIST.path)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
message: z.string(),
|
||||
secretImports: SecretImportsSchema.omit({ importEnv: true })
|
||||
|
||||
@@ -7,8 +7,6 @@ import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
import { DefaultResponseErrorsSchema } from "../sanitizedSchemas";
|
||||
|
||||
export const registerSecretTagRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
method: "GET",
|
||||
@@ -21,7 +19,6 @@ export const registerSecretTagRouter = async (server: FastifyZodProvider) => {
|
||||
projectId: z.string().trim().describe(SECRET_TAGS.LIST.projectId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
workspaceTags: SecretTagsSchema.array()
|
||||
})
|
||||
@@ -52,7 +49,6 @@ export const registerSecretTagRouter = async (server: FastifyZodProvider) => {
|
||||
tagId: z.string().trim().describe(SECRET_TAGS.GET_TAG_BY_ID.tagId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
// akhilmhdh: for terraform backward compatiability
|
||||
workspaceTag: SecretTagsSchema.extend({ name: z.string() })
|
||||
@@ -84,7 +80,6 @@ export const registerSecretTagRouter = async (server: FastifyZodProvider) => {
|
||||
tagSlug: z.string().trim().describe(SECRET_TAGS.GET_TAG_BY_SLUG.tagSlug)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
// akhilmhdh: for terraform backward compatiability
|
||||
workspaceTag: SecretTagsSchema.extend({ name: z.string() })
|
||||
@@ -127,7 +122,6 @@ export const registerSecretTagRouter = async (server: FastifyZodProvider) => {
|
||||
color: z.string().trim().describe(SECRET_TAGS.CREATE.color)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
workspaceTag: SecretTagsSchema
|
||||
})
|
||||
@@ -170,7 +164,6 @@ export const registerSecretTagRouter = async (server: FastifyZodProvider) => {
|
||||
color: z.string().trim().describe(SECRET_TAGS.UPDATE.color)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
workspaceTag: SecretTagsSchema
|
||||
})
|
||||
@@ -202,7 +195,6 @@ export const registerSecretTagRouter = async (server: FastifyZodProvider) => {
|
||||
tagId: z.string().trim().describe(SECRET_TAGS.DELETE.tagId)
|
||||
}),
|
||||
response: {
|
||||
...DefaultResponseErrorsSchema,
|
||||
200: z.object({
|
||||
workspaceTag: SecretTagsSchema
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user