mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 09:28:36 +00:00
doc: API references
This commit is contained in:
@@ -1147,6 +1147,32 @@ export const CERTIFICATES = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const CERTIFICATE_TEMPLATES = {
|
||||||
|
CREATE: {
|
||||||
|
caId: "The ID of the certificate authority to associate the template with",
|
||||||
|
pkiCollectionId: "The ID of the PKI collection to bind to the template",
|
||||||
|
name: "The name of the template",
|
||||||
|
commonName: "The regular expression string to use for validating common names",
|
||||||
|
subjectAlternativeName: "The regular expression string to use for validating subject alternative names",
|
||||||
|
ttl: "The max TTL for the template"
|
||||||
|
},
|
||||||
|
GET: {
|
||||||
|
certificateTemplateId: "The ID of the certificate template to get"
|
||||||
|
},
|
||||||
|
UPDATE: {
|
||||||
|
certificateTemplateId: "The ID of the certificate template to update",
|
||||||
|
caId: "The ID of the certificate authority to update the association with the template",
|
||||||
|
pkiCollectionId: "The ID of the PKI collection to update the binding to the template",
|
||||||
|
name: "The updated name of the template",
|
||||||
|
commonName: "The updated regular expression string for validating common names",
|
||||||
|
subjectAlternativeName: "The updated regular expression string for validating subject alternative names",
|
||||||
|
ttl: "The updated max TTL for the template"
|
||||||
|
},
|
||||||
|
DELETE: {
|
||||||
|
certificateTemplateId: "The ID of the certificate template to delete"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export const ALERTS = {
|
export const ALERTS = {
|
||||||
CREATE: {
|
CREATE: {
|
||||||
projectId: "The ID of the project to create the alert in",
|
projectId: "The ID of the project to create the alert in",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { z } from "zod";
|
|||||||
|
|
||||||
import { CertificateTemplatesSchema } from "@app/db/schemas";
|
import { CertificateTemplatesSchema } from "@app/db/schemas";
|
||||||
import { EventType } from "@app/ee/services/audit-log/audit-log-types";
|
import { EventType } from "@app/ee/services/audit-log/audit-log-types";
|
||||||
|
import { CERTIFICATE_TEMPLATES } from "@app/lib/api-docs";
|
||||||
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||||
import { AuthMode } from "@app/services/auth/auth-type";
|
import { AuthMode } from "@app/services/auth/auth-type";
|
||||||
@@ -27,7 +28,7 @@ export const registerCertificateTemplateRouter = async (server: FastifyZodProvid
|
|||||||
},
|
},
|
||||||
schema: {
|
schema: {
|
||||||
params: z.object({
|
params: z.object({
|
||||||
certificateTemplateId: z.string()
|
certificateTemplateId: z.string().describe(CERTIFICATE_TEMPLATES.GET.certificateTemplateId)
|
||||||
}),
|
}),
|
||||||
response: {
|
response: {
|
||||||
200: z.object({
|
200: z.object({
|
||||||
@@ -73,12 +74,17 @@ export const registerCertificateTemplateRouter = async (server: FastifyZodProvid
|
|||||||
},
|
},
|
||||||
schema: {
|
schema: {
|
||||||
body: z.object({
|
body: z.object({
|
||||||
caId: z.string(),
|
caId: z.string().describe(CERTIFICATE_TEMPLATES.CREATE.caId),
|
||||||
pkiCollectionId: z.string().optional(),
|
pkiCollectionId: z.string().optional().describe(CERTIFICATE_TEMPLATES.CREATE.pkiCollectionId),
|
||||||
name: z.string().min(1),
|
name: z.string().min(1).describe(CERTIFICATE_TEMPLATES.CREATE.name),
|
||||||
commonName: validateTemplateRegexField,
|
commonName: validateTemplateRegexField.describe(CERTIFICATE_TEMPLATES.CREATE.commonName),
|
||||||
subjectAlternativeName: validateTemplateRegexField,
|
subjectAlternativeName: validateTemplateRegexField.describe(
|
||||||
ttl: z.string().refine((val) => ms(val) > 0, "TTL must be a positive number")
|
CERTIFICATE_TEMPLATES.CREATE.subjectAlternativeName
|
||||||
|
),
|
||||||
|
ttl: z
|
||||||
|
.string()
|
||||||
|
.refine((val) => ms(val) > 0, "TTL must be a positive number")
|
||||||
|
.describe(CERTIFICATE_TEMPLATES.CREATE.ttl)
|
||||||
}),
|
}),
|
||||||
response: {
|
response: {
|
||||||
200: z.object({
|
200: z.object({
|
||||||
@@ -119,18 +125,21 @@ export const registerCertificateTemplateRouter = async (server: FastifyZodProvid
|
|||||||
},
|
},
|
||||||
schema: {
|
schema: {
|
||||||
body: z.object({
|
body: z.object({
|
||||||
caId: z.string().optional(),
|
caId: z.string().optional().describe(CERTIFICATE_TEMPLATES.UPDATE.caId),
|
||||||
pkiCollectionId: z.string().optional(),
|
pkiCollectionId: z.string().optional().describe(CERTIFICATE_TEMPLATES.UPDATE.pkiCollectionId),
|
||||||
name: z.string().min(1).optional(),
|
name: z.string().min(1).optional().describe(CERTIFICATE_TEMPLATES.UPDATE.name),
|
||||||
commonName: validateTemplateRegexField.optional(),
|
commonName: validateTemplateRegexField.optional().describe(CERTIFICATE_TEMPLATES.UPDATE.commonName),
|
||||||
subjectAlternativeName: validateTemplateRegexField.optional(),
|
subjectAlternativeName: validateTemplateRegexField
|
||||||
|
.optional()
|
||||||
|
.describe(CERTIFICATE_TEMPLATES.UPDATE.subjectAlternativeName),
|
||||||
ttl: z
|
ttl: z
|
||||||
.string()
|
.string()
|
||||||
.refine((val) => ms(val) > 0, "TTL must be a positive number")
|
.refine((val) => ms(val) > 0, "TTL must be a positive number")
|
||||||
.optional()
|
.optional()
|
||||||
|
.describe(CERTIFICATE_TEMPLATES.UPDATE.ttl)
|
||||||
}),
|
}),
|
||||||
params: z.object({
|
params: z.object({
|
||||||
certificateTemplateId: z.string()
|
certificateTemplateId: z.string().describe(CERTIFICATE_TEMPLATES.UPDATE.certificateTemplateId)
|
||||||
}),
|
}),
|
||||||
response: {
|
response: {
|
||||||
200: z.object({
|
200: z.object({
|
||||||
@@ -172,7 +181,7 @@ export const registerCertificateTemplateRouter = async (server: FastifyZodProvid
|
|||||||
},
|
},
|
||||||
schema: {
|
schema: {
|
||||||
params: z.object({
|
params: z.object({
|
||||||
certificateTemplateId: z.string()
|
certificateTemplateId: z.string().describe(CERTIFICATE_TEMPLATES.DELETE.certificateTemplateId)
|
||||||
}),
|
}),
|
||||||
response: {
|
response: {
|
||||||
200: z.object({
|
200: z.object({
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Create"
|
||||||
|
openapi: "POST /api/v1/pki/certificate-templates"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Delete"
|
||||||
|
openapi: "DELETE /api/v1/pki/certificate-templates/{certificateTemplateId}"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Get by ID"
|
||||||
|
openapi: "GET /api/v1/pki/certificate-templates/{certificateTemplateId}"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Update"
|
||||||
|
openapi: "PATCH /api/v1/pki/certificate-templates/{certificateTemplateId}"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Issue Certificate"
|
||||||
|
openapi: "POST /api/v1/pki/certificates/issue-certificate"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Sign Certificate"
|
||||||
|
openapi: "POST /api/v1/pki/certificates/sign-certificate"
|
||||||
|
---
|
||||||
+12
-1
@@ -686,7 +686,18 @@
|
|||||||
"api-reference/endpoints/certificates/read",
|
"api-reference/endpoints/certificates/read",
|
||||||
"api-reference/endpoints/certificates/revoke",
|
"api-reference/endpoints/certificates/revoke",
|
||||||
"api-reference/endpoints/certificates/delete",
|
"api-reference/endpoints/certificates/delete",
|
||||||
"api-reference/endpoints/certificates/cert-body"
|
"api-reference/endpoints/certificates/cert-body",
|
||||||
|
"api-reference/endpoints/certificates/issue-certificate",
|
||||||
|
"api-reference/endpoints/certificates/sign-certificate"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group": "Certificate Templates",
|
||||||
|
"pages": [
|
||||||
|
"api-reference/endpoints/certificate-templates/create",
|
||||||
|
"api-reference/endpoints/certificate-templates/update",
|
||||||
|
"api-reference/endpoints/certificate-templates/get-by-id",
|
||||||
|
"api-reference/endpoints/certificate-templates/delete"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user