mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 10:28:22 +00:00
Expose ssh endpoints to api reference, update ssh sign/issue endpoints
This commit is contained in:
@@ -26,8 +26,8 @@ import { registerSecretScanningRouter } from "./secret-scanning-router";
|
|||||||
import { registerSecretVersionRouter } from "./secret-version-router";
|
import { registerSecretVersionRouter } from "./secret-version-router";
|
||||||
import { registerSnapshotRouter } from "./snapshot-router";
|
import { registerSnapshotRouter } from "./snapshot-router";
|
||||||
import { registerSshCaRouter } from "./ssh-certificate-authority-router";
|
import { registerSshCaRouter } from "./ssh-certificate-authority-router";
|
||||||
|
import { registerSshCertRouter } from "./ssh-certificate-router";
|
||||||
import { registerSshCertificateTemplateRouter } from "./ssh-certificate-template-router";
|
import { registerSshCertificateTemplateRouter } from "./ssh-certificate-template-router";
|
||||||
import { registerSshRouter } from "./ssh-router";
|
|
||||||
import { registerTrustedIpRouter } from "./trusted-ip-router";
|
import { registerTrustedIpRouter } from "./trusted-ip-router";
|
||||||
import { registerUserAdditionalPrivilegeRouter } from "./user-additional-privilege-router";
|
import { registerUserAdditionalPrivilegeRouter } from "./user-additional-privilege-router";
|
||||||
|
|
||||||
@@ -73,8 +73,8 @@ export const registerV1EERoutes = async (server: FastifyZodProvider) => {
|
|||||||
|
|
||||||
await server.register(
|
await server.register(
|
||||||
async (sshRouter) => {
|
async (sshRouter) => {
|
||||||
await sshRouter.register(registerSshRouter, { prefix: "/" });
|
|
||||||
await sshRouter.register(registerSshCaRouter, { prefix: "/ca" });
|
await sshRouter.register(registerSshCaRouter, { prefix: "/ca" });
|
||||||
|
await sshRouter.register(registerSshCertRouter, { prefix: "/certificates" });
|
||||||
await sshRouter.register(registerSshCertificateTemplateRouter, { prefix: "/certificate-templates" });
|
await sshRouter.register(registerSshCertificateTemplateRouter, { prefix: "/certificate-templates" });
|
||||||
},
|
},
|
||||||
{ prefix: "/ssh" }
|
{ prefix: "/ssh" }
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ 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";
|
||||||
import { CertKeyAlgorithm } from "@app/services/certificate/certificate-types";
|
import { CertKeyAlgorithm } from "@app/services/certificate/certificate-types";
|
||||||
|
|
||||||
export const registerSshRouter = async (server: FastifyZodProvider) => {
|
export const registerSshCertRouter = async (server: FastifyZodProvider) => {
|
||||||
server.route({
|
server.route({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/sign",
|
url: "/sign",
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Create"
|
||||||
|
openapi: "POST /api/v1/ssh/ca"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Delete"
|
||||||
|
openapi: "DELETE /api/v1/ssh/ca/{sshCaId}"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "List templates"
|
||||||
|
openapi: "GET /api/v1/ssh/ca/{sshCaId}/certificate-templates"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "List"
|
||||||
|
openapi: "GET /api/v2/workspace/{projectId}/ssh-cas"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Retrieve public key"
|
||||||
|
openapi: "GET /api/v1/ssh/ca/{sshCaId}/public-key"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Retrieve"
|
||||||
|
openapi: "GET /api/v1/ssh/ca/{sshCaId}"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Update"
|
||||||
|
openapi: "PATCH /api/v1/ssh/ca/{sshCaId}"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Create"
|
||||||
|
openapi: "POST /api/v1/ssh/certificate-templates"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Delete"
|
||||||
|
openapi: "DELETE /api/v1/ssh/certificate-templates/{certificateTemplateId}"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "List"
|
||||||
|
openapi: "GET /api/v2/workspace/{projectId}/ssh-certificate-templates"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Retrieve"
|
||||||
|
openapi: "GET /api/v1/ssh/certificate-templates/{certificateTemplateId}"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Update"
|
||||||
|
openapi: "PATCH /api/v1/ssh/certificate-templates/{certificateTemplateId}"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Issue SSH Credentials"
|
||||||
|
openapi: "POST /api/v1/ssh/certificates/issue"
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Sign SSH Public Key"
|
||||||
|
openapi: "POST /api/v1/ssh/certificates/sign"
|
||||||
|
---
|
||||||
@@ -847,6 +847,40 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"group": "Infisical SSH",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"group": "Certificates",
|
||||||
|
"pages": [
|
||||||
|
"api-reference/endpoints/ssh/certificates/issue-credentials",
|
||||||
|
"api-reference/endpoints/ssh/certificates/sign-key"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group": "Certificate Authorities",
|
||||||
|
"pages": [
|
||||||
|
"api-reference/endpoints/ssh/ca/list",
|
||||||
|
"api-reference/endpoints/ssh/ca/create",
|
||||||
|
"api-reference/endpoints/ssh/ca/read",
|
||||||
|
"api-reference/endpoints/ssh/ca/update",
|
||||||
|
"api-reference/endpoints/ssh/ca/delete",
|
||||||
|
"api-reference/endpoints/ssh/ca/public-key",
|
||||||
|
"api-reference/endpoints/ssh/ca/list-certificate-templates"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group": "Certificate Templates",
|
||||||
|
"pages": [
|
||||||
|
"api-reference/endpoints/ssh/certificate-templates/list",
|
||||||
|
"api-reference/endpoints/ssh/certificate-templates/create",
|
||||||
|
"api-reference/endpoints/ssh/certificate-templates/read",
|
||||||
|
"api-reference/endpoints/ssh/certificate-templates/update",
|
||||||
|
"api-reference/endpoints/ssh/certificate-templates/delete"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"group": "Infisical KMS",
|
"group": "Infisical KMS",
|
||||||
"pages": [
|
"pages": [
|
||||||
|
|||||||
@@ -68,7 +68,10 @@ export const useSignSshKey = () => {
|
|||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
return useMutation<TSignSshKeyResponse, {}, TSignSshKeyDTO>({
|
return useMutation<TSignSshKeyResponse, {}, TSignSshKeyDTO>({
|
||||||
mutationFn: async (body) => {
|
mutationFn: async (body) => {
|
||||||
const { data } = await apiRequest.post<TSignSshKeyResponse>("/api/v1/ssh/sign", body);
|
const { data } = await apiRequest.post<TSignSshKeyResponse>(
|
||||||
|
"/api/v1/ssh/certificates/sign",
|
||||||
|
body
|
||||||
|
);
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
onSuccess: (_, { projectId }) => {
|
onSuccess: (_, { projectId }) => {
|
||||||
@@ -81,7 +84,10 @@ export const useIssueSshCreds = () => {
|
|||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
return useMutation<TIssueSshCredsResponse, {}, TIssueSshCredsDTO>({
|
return useMutation<TIssueSshCredsResponse, {}, TIssueSshCredsDTO>({
|
||||||
mutationFn: async (body) => {
|
mutationFn: async (body) => {
|
||||||
const { data } = await apiRequest.post<TIssueSshCredsResponse>("/api/v1/ssh/issue", body);
|
const { data } = await apiRequest.post<TIssueSshCredsResponse>(
|
||||||
|
"/api/v1/ssh/certificates/issue",
|
||||||
|
body
|
||||||
|
);
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
onSuccess: (_, { projectId }) => {
|
onSuccess: (_, { projectId }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user