mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-17 16:27:39 +00:00
Merge branch 'main' into ENG-3925
This commit is contained in:
@@ -176,6 +176,7 @@ import { externalGroupOrgRoleMappingDALFactory } from "@app/services/external-gr
|
||||
import { externalGroupOrgRoleMappingServiceFactory } from "@app/services/external-group-org-role-mapping/external-group-org-role-mapping-service";
|
||||
import { externalMigrationQueueFactory } from "@app/services/external-migration/external-migration-queue";
|
||||
import { externalMigrationServiceFactory } from "@app/services/external-migration/external-migration-service";
|
||||
import { vaultExternalMigrationConfigDALFactory } from "@app/services/external-migration/vault-external-migration-config-dal";
|
||||
import { folderCheckpointDALFactory } from "@app/services/folder-checkpoint/folder-checkpoint-dal";
|
||||
import { folderCheckpointResourcesDALFactory } from "@app/services/folder-checkpoint-resources/folder-checkpoint-resources-dal";
|
||||
import { folderCommitDALFactory } from "@app/services/folder-commit/folder-commit-dal";
|
||||
@@ -535,6 +536,8 @@ export const registerRoutes = async (
|
||||
const membershipRoleDAL = membershipRoleDALFactory(db);
|
||||
const roleDAL = roleDALFactory(db);
|
||||
|
||||
const vaultExternalMigrationConfigDAL = vaultExternalMigrationConfigDALFactory(db);
|
||||
|
||||
const eventBusService = eventBusFactory(server.redis);
|
||||
const sseService = sseServiceFactory(eventBusService, server.redis);
|
||||
|
||||
@@ -1345,7 +1348,8 @@ export const registerRoutes = async (
|
||||
projectDAL,
|
||||
folderCommitService,
|
||||
secretApprovalPolicyService,
|
||||
secretV2BridgeDAL
|
||||
secretV2BridgeDAL,
|
||||
dynamicSecretDAL
|
||||
});
|
||||
|
||||
const secretImportService = secretImportServiceFactory({
|
||||
@@ -1882,13 +1886,6 @@ export const registerRoutes = async (
|
||||
notificationService
|
||||
});
|
||||
|
||||
const migrationService = externalMigrationServiceFactory({
|
||||
externalMigrationQueue,
|
||||
userDAL,
|
||||
permissionService,
|
||||
gatewayService
|
||||
});
|
||||
|
||||
const externalGroupOrgRoleMappingService = externalGroupOrgRoleMappingServiceFactory({
|
||||
permissionService,
|
||||
licenseService,
|
||||
@@ -2211,6 +2208,18 @@ export const registerRoutes = async (
|
||||
kmsService
|
||||
});
|
||||
|
||||
const migrationService = externalMigrationServiceFactory({
|
||||
externalMigrationQueue,
|
||||
userDAL,
|
||||
permissionService,
|
||||
gatewayService,
|
||||
kmsService,
|
||||
appConnectionService,
|
||||
vaultExternalMigrationConfigDAL,
|
||||
secretService,
|
||||
auditLogService
|
||||
});
|
||||
|
||||
// setup the communication with license key server
|
||||
await licenseService.init();
|
||||
|
||||
|
||||
@@ -77,6 +77,10 @@ import {
|
||||
HumanitecConnectionListItemSchema,
|
||||
SanitizedHumanitecConnectionSchema
|
||||
} from "@app/services/app-connection/humanitec";
|
||||
import {
|
||||
LaravelForgeConnectionListItemSchema,
|
||||
SanitizedLaravelForgeConnectionSchema
|
||||
} from "@app/services/app-connection/laravel-forge";
|
||||
import { LdapConnectionListItemSchema, SanitizedLdapConnectionSchema } from "@app/services/app-connection/ldap";
|
||||
import { MsSqlConnectionListItemSchema, SanitizedMsSqlConnectionSchema } from "@app/services/app-connection/mssql";
|
||||
import { MySqlConnectionListItemSchema, SanitizedMySqlConnectionSchema } from "@app/services/app-connection/mysql";
|
||||
@@ -158,7 +162,8 @@ const SanitizedAppConnectionSchema = z.union([
|
||||
...SanitizedNetlifyConnectionSchema.options,
|
||||
...SanitizedOktaConnectionSchema.options,
|
||||
...SanitizedAzureADCSConnectionSchema.options,
|
||||
...SanitizedRedisConnectionSchema.options
|
||||
...SanitizedRedisConnectionSchema.options,
|
||||
...SanitizedLaravelForgeConnectionSchema.options
|
||||
]);
|
||||
|
||||
const AppConnectionOptionsSchema = z.discriminatedUnion("app", [
|
||||
@@ -200,7 +205,8 @@ const AppConnectionOptionsSchema = z.discriminatedUnion("app", [
|
||||
NetlifyConnectionListItemSchema,
|
||||
OktaConnectionListItemSchema,
|
||||
AzureADCSConnectionListItemSchema,
|
||||
RedisConnectionListItemSchema
|
||||
RedisConnectionListItemSchema,
|
||||
LaravelForgeConnectionListItemSchema
|
||||
]);
|
||||
|
||||
export const registerAppConnectionRouter = async (server: FastifyZodProvider) => {
|
||||
|
||||
@@ -24,6 +24,7 @@ import { registerGitLabConnectionRouter } from "./gitlab-connection-router";
|
||||
import { registerHCVaultConnectionRouter } from "./hc-vault-connection-router";
|
||||
import { registerHerokuConnectionRouter } from "./heroku-connection-router";
|
||||
import { registerHumanitecConnectionRouter } from "./humanitec-connection-router";
|
||||
import { registerLaravelForgeConnectionRouter } from "./laravel-forge-connection-router";
|
||||
import { registerLdapConnectionRouter } from "./ldap-connection-router";
|
||||
import { registerMsSqlConnectionRouter } from "./mssql-connection-router";
|
||||
import { registerMySqlConnectionRouter } from "./mysql-connection-router";
|
||||
@@ -71,6 +72,7 @@ export const APP_CONNECTION_REGISTER_ROUTER_MAP: Record<AppConnection, (server:
|
||||
[AppConnection.OnePass]: registerOnePassConnectionRouter,
|
||||
[AppConnection.Heroku]: registerHerokuConnectionRouter,
|
||||
[AppConnection.Render]: registerRenderConnectionRouter,
|
||||
[AppConnection.LaravelForge]: registerLaravelForgeConnectionRouter,
|
||||
[AppConnection.Flyio]: registerFlyioConnectionRouter,
|
||||
[AppConnection.GitLab]: registerGitLabConnectionRouter,
|
||||
[AppConnection.Cloudflare]: registerCloudflareConnectionRouter,
|
||||
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
import z from "zod";
|
||||
|
||||
import { readLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
|
||||
import {
|
||||
CreateLaravelForgeConnectionSchema,
|
||||
SanitizedLaravelForgeConnectionSchema,
|
||||
UpdateLaravelForgeConnectionSchema
|
||||
} from "@app/services/app-connection/laravel-forge";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
|
||||
import { registerAppConnectionEndpoints } from "./app-connection-endpoints";
|
||||
|
||||
export const registerLaravelForgeConnectionRouter = async (server: FastifyZodProvider) => {
|
||||
registerAppConnectionEndpoints({
|
||||
app: AppConnection.LaravelForge,
|
||||
server,
|
||||
sanitizedResponseSchema: SanitizedLaravelForgeConnectionSchema,
|
||||
createSchema: CreateLaravelForgeConnectionSchema,
|
||||
updateSchema: UpdateLaravelForgeConnectionSchema
|
||||
});
|
||||
server.route({
|
||||
method: "GET",
|
||||
url: `/:connectionId/organizations`,
|
||||
config: {
|
||||
rateLimit: readLimit
|
||||
},
|
||||
schema: {
|
||||
params: z.object({
|
||||
connectionId: z.string().uuid()
|
||||
}),
|
||||
response: {
|
||||
200: z
|
||||
.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
slug: z.string()
|
||||
})
|
||||
.array()
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const { connectionId } = req.params;
|
||||
const organizations = await server.services.appConnection.laravelForge.listOrganizations(
|
||||
connectionId,
|
||||
req.permission
|
||||
);
|
||||
|
||||
return organizations;
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "GET",
|
||||
url: `/:connectionId/servers`,
|
||||
config: {
|
||||
rateLimit: readLimit
|
||||
},
|
||||
schema: {
|
||||
params: z.object({
|
||||
connectionId: z.string().uuid()
|
||||
}),
|
||||
querystring: z.object({
|
||||
organizationSlug: z.string()
|
||||
}),
|
||||
response: {
|
||||
200: z
|
||||
.object({
|
||||
id: z.string(),
|
||||
name: z.string()
|
||||
})
|
||||
.array()
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const { connectionId } = req.params;
|
||||
const { organizationSlug } = req.query;
|
||||
const servers = await server.services.appConnection.laravelForge.listServers(
|
||||
connectionId,
|
||||
req.permission,
|
||||
organizationSlug
|
||||
);
|
||||
|
||||
return servers;
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "GET",
|
||||
url: `/:connectionId/sites`,
|
||||
config: {
|
||||
rateLimit: readLimit
|
||||
},
|
||||
schema: {
|
||||
params: z.object({
|
||||
connectionId: z.string().uuid()
|
||||
}),
|
||||
querystring: z.object({
|
||||
organizationSlug: z.string(),
|
||||
serverId: z.string()
|
||||
}),
|
||||
response: {
|
||||
200: z
|
||||
.object({
|
||||
id: z.string(),
|
||||
name: z.string()
|
||||
})
|
||||
.array()
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const { connectionId } = req.params;
|
||||
const { organizationSlug, serverId } = req.query;
|
||||
const sites = await server.services.appConnection.laravelForge.listSites(
|
||||
connectionId,
|
||||
req.permission,
|
||||
organizationSlug,
|
||||
serverId
|
||||
);
|
||||
|
||||
return sites;
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -318,7 +318,8 @@ export const registerDeprecatedSecretFolderRouter = async (server: FastifyZodPro
|
||||
...req.body,
|
||||
projectId: req.body.workspaceId,
|
||||
idOrName: req.params.folderIdOrName,
|
||||
path
|
||||
path,
|
||||
forceDelete: true
|
||||
});
|
||||
await server.services.auditLog.createAuditLog({
|
||||
...req.auditLogInfo,
|
||||
|
||||
@@ -13,7 +13,7 @@ export const registerIdentityAccessTokenRouter = async (server: FastifyZodProvid
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.UniversalAuth],
|
||||
description: "Renew access token",
|
||||
description: "Renew machine identity access token",
|
||||
body: z.object({
|
||||
accessToken: z.string().trim().describe(UNIVERSAL_AUTH.RENEW_ACCESS_TOKEN.accessToken)
|
||||
}),
|
||||
@@ -48,7 +48,7 @@ export const registerIdentityAccessTokenRouter = async (server: FastifyZodProvid
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.UniversalAuth],
|
||||
description: "Revoke access token",
|
||||
description: "Revoke machine identity access token",
|
||||
body: z.object({
|
||||
accessToken: z.string().trim().describe(UNIVERSAL_AUTH.REVOKE_ACCESS_TOKEN.accessToken)
|
||||
}),
|
||||
|
||||
@@ -21,7 +21,7 @@ export const registerIdentityAliCloudAuthRouter = async (server: FastifyZodProvi
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AliCloudAuth],
|
||||
description: "Login with Alibaba Cloud Auth",
|
||||
description: "Login with Alibaba Cloud Auth for machine identity",
|
||||
body: z.object({
|
||||
identityId: z.string().trim().describe(ALICLOUD_AUTH.LOGIN.identityId),
|
||||
Action: z.enum(["GetCallerIdentity"]).describe(ALICLOUD_AUTH.LOGIN.Action),
|
||||
@@ -108,7 +108,7 @@ export const registerIdentityAliCloudAuthRouter = async (server: FastifyZodProvi
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AliCloudAuth],
|
||||
description: "Attach Alibaba Cloud Auth configuration onto identity",
|
||||
description: "Attach Alibaba Cloud Auth configuration onto machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -200,7 +200,7 @@ export const registerIdentityAliCloudAuthRouter = async (server: FastifyZodProvi
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AliCloudAuth],
|
||||
description: "Update Alibaba Cloud Auth configuration on identity",
|
||||
description: "Update Alibaba Cloud Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -292,7 +292,7 @@ export const registerIdentityAliCloudAuthRouter = async (server: FastifyZodProvi
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AliCloudAuth],
|
||||
description: "Retrieve Alibaba Cloud Auth configuration on identity",
|
||||
description: "Retrieve Alibaba Cloud Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -340,7 +340,7 @@ export const registerIdentityAliCloudAuthRouter = async (server: FastifyZodProvi
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AliCloudAuth],
|
||||
description: "Delete Alibaba Cloud Auth configuration on identity",
|
||||
description: "Delete Alibaba Cloud Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -23,7 +23,7 @@ export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AwsAuth],
|
||||
description: "Login with AWS Auth",
|
||||
description: "Login with AWS Auth for machine identity",
|
||||
body: z.object({
|
||||
identityId: z.string().trim().describe(AWS_AUTH.LOGIN.identityId),
|
||||
iamHttpRequestMethod: z.string().default("POST").describe(AWS_AUTH.LOGIN.iamHttpRequestMethod),
|
||||
@@ -75,7 +75,7 @@ export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AwsAuth],
|
||||
description: "Attach AWS Auth configuration onto identity",
|
||||
description: "Attach AWS Auth configuration onto machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -171,7 +171,7 @@ export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AwsAuth],
|
||||
description: "Update AWS Auth configuration on identity",
|
||||
description: "Update AWS Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -255,7 +255,7 @@ export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AwsAuth],
|
||||
description: "Retrieve AWS Auth configuration on identity",
|
||||
description: "Retrieve AWS Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -303,7 +303,7 @@ export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AwsAuth],
|
||||
description: "Delete AWS Auth configuration on identity",
|
||||
description: "Delete AWS Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -20,7 +20,7 @@ export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AzureAuth],
|
||||
description: "Login with Azure Auth",
|
||||
description: "Login with Azure Auth for machine identity",
|
||||
body: z.object({
|
||||
identityId: z.string().trim().describe(AZURE_AUTH.LOGIN.identityId),
|
||||
jwt: z.string()
|
||||
@@ -70,7 +70,7 @@ export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AzureAuth],
|
||||
description: "Attach Azure Auth configuration onto identity",
|
||||
description: "Attach Azure Auth configuration onto machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -165,7 +165,7 @@ export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AzureAuth],
|
||||
description: "Update Azure Auth configuration on identity",
|
||||
description: "Update Azure Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -255,7 +255,7 @@ export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AzureAuth],
|
||||
description: "Retrieve Azure Auth configuration on identity",
|
||||
description: "Retrieve Azure Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -304,7 +304,7 @@ export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.AzureAuth],
|
||||
description: "Delete Azure Auth configuration on identity",
|
||||
description: "Delete Azure Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -20,7 +20,7 @@ export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.GcpAuth],
|
||||
description: "Login with GCP Auth",
|
||||
description: "Login with GCP Auth for machine identity",
|
||||
body: z.object({
|
||||
identityId: z.string().trim().describe(GCP_AUTH.LOGIN.identityId),
|
||||
jwt: z.string()
|
||||
@@ -70,7 +70,7 @@ export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.GcpAuth],
|
||||
description: "Attach GCP Auth configuration onto identity",
|
||||
description: "Attach GCP Auth configuration onto machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -163,7 +163,7 @@ export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.GcpAuth],
|
||||
description: "Update GCP Auth configuration on identity",
|
||||
description: "Update GCP Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -249,7 +249,7 @@ export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.GcpAuth],
|
||||
description: "Retrieve GCP Auth configuration on identity",
|
||||
description: "Retrieve GCP Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -298,7 +298,7 @@ export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.GcpAuth],
|
||||
description: "Delete GCP Auth configuration on identity",
|
||||
description: "Delete GCP Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -96,7 +96,7 @@ export const registerIdentityJwtAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.JwtAuth],
|
||||
description: "Login with JWT Auth",
|
||||
description: "Login with JWT Auth for machine identity",
|
||||
body: z.object({
|
||||
identityId: z.string().trim().describe(JWT_AUTH.LOGIN.identityId),
|
||||
jwt: z.string().trim()
|
||||
@@ -148,7 +148,7 @@ export const registerIdentityJwtAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.JwtAuth],
|
||||
description: "Attach JWT Auth configuration onto identity",
|
||||
description: "Attach JWT Auth configuration onto machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -217,7 +217,7 @@ export const registerIdentityJwtAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.JwtAuth],
|
||||
description: "Update JWT Auth configuration on identity",
|
||||
description: "Update JWT Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -283,7 +283,7 @@ export const registerIdentityJwtAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.JwtAuth],
|
||||
description: "Retrieve JWT Auth configuration on identity",
|
||||
description: "Retrieve JWT Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -332,7 +332,7 @@ export const registerIdentityJwtAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.JwtAuth],
|
||||
description: "Delete JWT Auth configuration on identity",
|
||||
description: "Delete JWT Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -41,7 +41,7 @@ export const registerIdentityKubernetesRouter = async (server: FastifyZodProvide
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.KubernetesAuth],
|
||||
description: "Login with Kubernetes Auth",
|
||||
description: "Login with Kubernetes Auth for machine identity",
|
||||
body: z.object({
|
||||
identityId: z.string().trim().describe(KUBERNETES_AUTH.LOGIN.identityId),
|
||||
jwt: z.string().trim()
|
||||
@@ -93,7 +93,7 @@ export const registerIdentityKubernetesRouter = async (server: FastifyZodProvide
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.KubernetesAuth],
|
||||
description: "Attach Kubernetes Auth configuration onto identity",
|
||||
description: "Attach Kubernetes Auth configuration onto machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -240,7 +240,7 @@ export const registerIdentityKubernetesRouter = async (server: FastifyZodProvide
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.KubernetesAuth],
|
||||
description: "Update Kubernetes Auth configuration on identity",
|
||||
description: "Update Kubernetes Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -383,7 +383,7 @@ export const registerIdentityKubernetesRouter = async (server: FastifyZodProvide
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.KubernetesAuth],
|
||||
description: "Retrieve Kubernetes Auth configuration on identity",
|
||||
description: "Retrieve Kubernetes Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -432,7 +432,7 @@ export const registerIdentityKubernetesRouter = async (server: FastifyZodProvide
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.KubernetesAuth],
|
||||
description: "Delete Kubernetes Auth configuration on identity",
|
||||
description: "Delete Kubernetes Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -120,7 +120,7 @@ export const registerIdentityLdapAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.LdapAuth],
|
||||
description: "Login with LDAP Auth",
|
||||
description: "Login with LDAP Auth for machine identity",
|
||||
body: z.object({
|
||||
identityId: z.string().trim().describe(LDAP_AUTH.LOGIN.identityId),
|
||||
username: z.string().describe(LDAP_AUTH.LOGIN.username),
|
||||
@@ -198,7 +198,7 @@ export const registerIdentityLdapAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.LdapAuth],
|
||||
description: "Attach LDAP Auth configuration onto identity",
|
||||
description: "Attach LDAP Auth configuration onto machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -389,7 +389,7 @@ export const registerIdentityLdapAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.LdapAuth],
|
||||
description: "Update LDAP Auth configuration on identity",
|
||||
description: "Update LDAP Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -510,7 +510,7 @@ export const registerIdentityLdapAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.LdapAuth],
|
||||
description: "Retrieve LDAP Auth configuration on identity",
|
||||
description: "Retrieve LDAP Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -568,7 +568,7 @@ export const registerIdentityLdapAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.LdapAuth],
|
||||
description: "Delete LDAP Auth configuration on identity",
|
||||
description: "Delete LDAP Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -621,7 +621,7 @@ export const registerIdentityLdapAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.LdapAuth],
|
||||
description: "Clear LDAP Auth Lockouts for identity",
|
||||
description: "Clear LDAP Auth Lockouts for machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -20,7 +20,7 @@ export const registerIdentityOciAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.OciAuth],
|
||||
description: "Login with OCI Auth",
|
||||
description: "Login with OCI Auth for machine identity",
|
||||
body: z.object({
|
||||
identityId: z.string().trim().describe(OCI_AUTH.LOGIN.identityId),
|
||||
userOcid: z.string().trim().describe(OCI_AUTH.LOGIN.userOcid),
|
||||
@@ -87,7 +87,7 @@ export const registerIdentityOciAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.OciAuth],
|
||||
description: "Attach OCI Auth configuration onto identity",
|
||||
description: "Attach OCI Auth configuration onto machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -176,7 +176,7 @@ export const registerIdentityOciAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.OciAuth],
|
||||
description: "Update OCI Auth configuration on identity",
|
||||
description: "Update OCI Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -259,7 +259,7 @@ export const registerIdentityOciAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.OciAuth],
|
||||
description: "Retrieve OCI Auth configuration on identity",
|
||||
description: "Retrieve OCI Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -307,7 +307,7 @@ export const registerIdentityOciAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.OciAuth],
|
||||
description: "Delete OCI Auth configuration on identity",
|
||||
description: "Delete OCI Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -44,7 +44,7 @@ export const registerIdentityOidcAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.OidcAuth],
|
||||
description: "Login with OIDC Auth",
|
||||
description: "Login with OIDC Auth for machine identity",
|
||||
body: z.object({
|
||||
identityId: z.string().trim().describe(OIDC_AUTH.LOGIN.identityId),
|
||||
jwt: z.string().trim()
|
||||
@@ -100,7 +100,7 @@ export const registerIdentityOidcAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.OidcAuth],
|
||||
description: "Attach OIDC Auth configuration onto identity",
|
||||
description: "Attach OIDC Auth configuration onto machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -201,7 +201,7 @@ export const registerIdentityOidcAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.OidcAuth],
|
||||
description: "Update OIDC Auth configuration on identity",
|
||||
description: "Update OIDC Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -300,7 +300,7 @@ export const registerIdentityOidcAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.OidcAuth],
|
||||
description: "Retrieve OIDC Auth configuration on identity",
|
||||
description: "Retrieve OIDC Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -349,7 +349,7 @@ export const registerIdentityOidcAuthRouter = async (server: FastifyZodProvider)
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.OidcAuth],
|
||||
description: "Delete OIDC Auth configuration on identity",
|
||||
description: "Delete OIDC Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -34,7 +34,7 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.Identities],
|
||||
description: "Create identity",
|
||||
description: "Create machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -109,7 +109,7 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.Identities],
|
||||
description: "Update identity",
|
||||
description: "Update machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -173,7 +173,7 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.Identities],
|
||||
description: "Delete identity",
|
||||
description: "Delete machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -222,7 +222,7 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.Identities],
|
||||
description: "Get an identity by id",
|
||||
description: "Get a machine identity by id",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -280,7 +280,7 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.Identities],
|
||||
description: "List identities",
|
||||
description: "List machine identities",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -330,7 +330,7 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.Identities],
|
||||
description: "Search identities",
|
||||
description: "Search machine identities",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -427,7 +427,7 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||
schema: {
|
||||
description: "List project memberships that identity with id is part of",
|
||||
description: "List project memberships that machine identity with id is part of",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -44,7 +44,7 @@ export const registerIdentityTlsCertAuthRouter = async (server: FastifyZodProvid
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TlsCertAuth],
|
||||
description: "Login with TLS Certificate Auth",
|
||||
description: "Login with TLS Certificate Auth for machine identity",
|
||||
body: z.object({
|
||||
identityId: z.string().trim().describe(TLS_CERT_AUTH.LOGIN.identityId)
|
||||
}),
|
||||
@@ -102,7 +102,7 @@ export const registerIdentityTlsCertAuthRouter = async (server: FastifyZodProvid
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TlsCertAuth],
|
||||
description: "Attach TLS Certificate Auth configuration onto identity",
|
||||
description: "Attach TLS Certificate Auth configuration onto machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -203,7 +203,7 @@ export const registerIdentityTlsCertAuthRouter = async (server: FastifyZodProvid
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TlsCertAuth],
|
||||
description: "Update TLS Certificate Auth configuration on identity",
|
||||
description: "Update TLS Certificate Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -304,7 +304,7 @@ export const registerIdentityTlsCertAuthRouter = async (server: FastifyZodProvid
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TlsCertAuth],
|
||||
description: "Retrieve TLS Certificate Auth configuration on identity",
|
||||
description: "Retrieve TLS Certificate Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -354,7 +354,7 @@ export const registerIdentityTlsCertAuthRouter = async (server: FastifyZodProvid
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TlsCertAuth],
|
||||
description: "Delete TLS Certificate Auth configuration on identity",
|
||||
description: "Delete TLS Certificate Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -20,7 +20,7 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TokenAuth],
|
||||
description: "Attach Token Auth configuration onto identity",
|
||||
description: "Attach Token Auth configuration onto machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -112,7 +112,7 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TokenAuth],
|
||||
description: "Update Token Auth configuration on identity",
|
||||
description: "Update Token Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -198,7 +198,7 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TokenAuth],
|
||||
description: "Retrieve Token Auth configuration on identity",
|
||||
description: "Retrieve Token Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -247,7 +247,7 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TokenAuth],
|
||||
description: "Delete Token Auth configuration on identity",
|
||||
description: "Delete Token Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -297,7 +297,7 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TokenAuth],
|
||||
description: "Create token for identity with Token Auth",
|
||||
description: "Create token for machine identity with Token Auth",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -361,7 +361,7 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TokenAuth],
|
||||
description: "Get tokens for identity with Token Auth",
|
||||
description: "Get tokens for machine identity with Token Auth",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -416,7 +416,7 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TokenAuth],
|
||||
description: "Update token for identity with Token Auth",
|
||||
description: "Update token for machine identity with Token Auth",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -472,7 +472,7 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.TokenAuth],
|
||||
description: "Revoke token for identity with Token Auth",
|
||||
description: "Revoke token for machine identity with Token Auth",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -32,7 +32,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.UniversalAuth],
|
||||
description: "Login with Universal Auth",
|
||||
description: "Login with Universal Auth for machine identity",
|
||||
body: z.object({
|
||||
clientId: z.string().trim().describe(UNIVERSAL_AUTH.LOGIN.clientId),
|
||||
clientSecret: z.string().trim().describe(UNIVERSAL_AUTH.LOGIN.clientSecret)
|
||||
@@ -90,7 +90,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.UniversalAuth],
|
||||
description: "Attach Universal Auth configuration onto identity",
|
||||
description: "Attach Universal Auth configuration onto machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -208,7 +208,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.UniversalAuth],
|
||||
description: "Update Universal Auth configuration on identity",
|
||||
description: "Update Universal Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -331,7 +331,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.UniversalAuth],
|
||||
description: "Retrieve Universal Auth configuration on identity",
|
||||
description: "Retrieve Universal Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -380,7 +380,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.UniversalAuth],
|
||||
description: "Delete Universal Auth configuration on identity",
|
||||
description: "Delete Universal Auth configuration on machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -429,7 +429,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.UniversalAuth],
|
||||
description: "Create Universal Auth Client Secret for identity",
|
||||
description: "Create Universal Auth Client Secret for machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -487,7 +487,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.UniversalAuth],
|
||||
description: "List Universal Auth Client Secrets for identity",
|
||||
description: "List Universal Auth Client Secrets for machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -537,7 +537,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.UniversalAuth],
|
||||
description: "Get Universal Auth Client Secret for identity",
|
||||
description: "Get Universal Auth Client Secret for machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -567,7 +567,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
...req.auditLogInfo,
|
||||
orgId: clientSecretData.orgId,
|
||||
event: {
|
||||
type: EventType.REVOKE_IDENTITY_UNIVERSAL_AUTH_CLIENT_SECRET,
|
||||
type: EventType.GET_IDENTITY_UNIVERSAL_AUTH_CLIENT_SECRET_BY_ID,
|
||||
metadata: {
|
||||
identityId: clientSecretData.identityId,
|
||||
clientSecretId: clientSecretData.id
|
||||
@@ -589,7 +589,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.UniversalAuth],
|
||||
description: "Revoke Universal Auth Client Secrets for identity",
|
||||
description: "Revoke Universal Auth Client Secrets for machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
@@ -641,7 +641,7 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
hide: false,
|
||||
tags: [ApiDocsTags.UniversalAuth],
|
||||
description: "Clear Universal Auth Lockouts for identity",
|
||||
description: "Clear Universal Auth Lockouts for machine identity",
|
||||
security: [
|
||||
{
|
||||
bearerAuth: []
|
||||
|
||||
@@ -21,6 +21,7 @@ import { registerGitLabSyncRouter } from "./gitlab-sync-router";
|
||||
import { registerHCVaultSyncRouter } from "./hc-vault-sync-router";
|
||||
import { registerHerokuSyncRouter } from "./heroku-sync-router";
|
||||
import { registerHumanitecSyncRouter } from "./humanitec-sync-router";
|
||||
import { registerLaravelForgeSyncRouter } from "./laravel-forge-sync-router";
|
||||
import { registerNetlifySyncRouter } from "./netlify-sync-router";
|
||||
import { registerRailwaySyncRouter } from "./railway-sync-router";
|
||||
import { registerRenderSyncRouter } from "./render-sync-router";
|
||||
@@ -63,5 +64,6 @@ export const SECRET_SYNC_REGISTER_ROUTER_MAP: Record<SecretSync, (server: Fastif
|
||||
[SecretSync.Checkly]: registerChecklySyncRouter,
|
||||
[SecretSync.DigitalOceanAppPlatform]: registerDigitalOceanAppPlatformSyncRouter,
|
||||
[SecretSync.Netlify]: registerNetlifySyncRouter,
|
||||
[SecretSync.Bitbucket]: registerBitbucketSyncRouter
|
||||
[SecretSync.Bitbucket]: registerBitbucketSyncRouter,
|
||||
[SecretSync.LaravelForge]: registerLaravelForgeSyncRouter
|
||||
};
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import {
|
||||
CreateLaravelForgeSyncSchema,
|
||||
LaravelForgeSyncSchema,
|
||||
UpdateLaravelForgeSyncSchema
|
||||
} from "@app/services/secret-sync/laravel-forge";
|
||||
import { SecretSync } from "@app/services/secret-sync/secret-sync-enums";
|
||||
|
||||
import { registerSyncSecretsEndpoints } from "./secret-sync-endpoints";
|
||||
|
||||
export const registerLaravelForgeSyncRouter = async (server: FastifyZodProvider) =>
|
||||
registerSyncSecretsEndpoints({
|
||||
destination: SecretSync.LaravelForge,
|
||||
server,
|
||||
responseSchema: LaravelForgeSyncSchema,
|
||||
createSchema: CreateLaravelForgeSyncSchema,
|
||||
updateSchema: UpdateLaravelForgeSyncSchema
|
||||
});
|
||||
@@ -44,6 +44,7 @@ import { GitLabSyncListItemSchema, GitLabSyncSchema } from "@app/services/secret
|
||||
import { HCVaultSyncListItemSchema, HCVaultSyncSchema } from "@app/services/secret-sync/hc-vault";
|
||||
import { HerokuSyncListItemSchema, HerokuSyncSchema } from "@app/services/secret-sync/heroku";
|
||||
import { HumanitecSyncListItemSchema, HumanitecSyncSchema } from "@app/services/secret-sync/humanitec";
|
||||
import { LaravelForgeSyncListItemSchema, LaravelForgeSyncSchema } from "@app/services/secret-sync/laravel-forge";
|
||||
import { NetlifySyncListItemSchema, NetlifySyncSchema } from "@app/services/secret-sync/netlify";
|
||||
import { RailwaySyncListItemSchema, RailwaySyncSchema } from "@app/services/secret-sync/railway/railway-sync-schemas";
|
||||
import { RenderSyncListItemSchema, RenderSyncSchema } from "@app/services/secret-sync/render/render-sync-schemas";
|
||||
@@ -84,7 +85,8 @@ const SecretSyncSchema = z.discriminatedUnion("destination", [
|
||||
ChecklySyncSchema,
|
||||
DigitalOceanAppPlatformSyncSchema,
|
||||
NetlifySyncSchema,
|
||||
BitbucketSyncSchema
|
||||
BitbucketSyncSchema,
|
||||
LaravelForgeSyncSchema
|
||||
]);
|
||||
|
||||
const SecretSyncOptionsSchema = z.discriminatedUnion("destination", [
|
||||
@@ -117,7 +119,8 @@ const SecretSyncOptionsSchema = z.discriminatedUnion("destination", [
|
||||
ChecklySyncListItemSchema,
|
||||
SupabaseSyncListItemSchema,
|
||||
NetlifySyncListItemSchema,
|
||||
BitbucketSyncListItemSchema
|
||||
BitbucketSyncListItemSchema,
|
||||
LaravelForgeSyncListItemSchema
|
||||
]);
|
||||
|
||||
export const registerSecretSyncRouter = async (server: FastifyZodProvider) => {
|
||||
|
||||
@@ -263,7 +263,8 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
|
||||
.default("/")
|
||||
.transform(prefixWithSlash) // Transformations get skipped if path is undefined
|
||||
.transform(removeTrailingSlash)
|
||||
.describe(FOLDERS.DELETE.path)
|
||||
.describe(FOLDERS.DELETE.path),
|
||||
forceDelete: z.boolean().optional().default(false).describe(FOLDERS.DELETE.forceDelete)
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
@@ -279,7 +280,8 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
|
||||
actorAuthMethod: req.permission.authMethod,
|
||||
actorOrgId: req.permission.orgId,
|
||||
...req.body,
|
||||
idOrName: req.params.folderIdOrName
|
||||
idOrName: req.params.folderIdOrName,
|
||||
forceDelete: req.body.forceDelete
|
||||
});
|
||||
await server.services.auditLog.createAuditLog({
|
||||
...req.auditLogInfo,
|
||||
|
||||
@@ -7,6 +7,7 @@ import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import {
|
||||
ExternalMigrationProviders,
|
||||
VaultImportStatus,
|
||||
VaultMappingType
|
||||
} from "@app/services/external-migration/external-migration-types";
|
||||
|
||||
@@ -113,4 +114,366 @@ export const registerExternalMigrationRouter = async (server: FastifyZodProvider
|
||||
return { enabled };
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "GET",
|
||||
url: "/vault/configs",
|
||||
config: {
|
||||
rateLimit: readLimit
|
||||
},
|
||||
schema: {
|
||||
response: {
|
||||
200: z.object({
|
||||
configs: z
|
||||
.object({
|
||||
id: z.string(),
|
||||
orgId: z.string(),
|
||||
namespace: z.string(),
|
||||
connectionId: z.string().nullish(),
|
||||
createdAt: z.date(),
|
||||
updatedAt: z.date()
|
||||
})
|
||||
.array()
|
||||
})
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const configs = await server.services.migration.getVaultExternalMigrationConfigs({
|
||||
actor: req.permission
|
||||
});
|
||||
|
||||
return { configs };
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "POST",
|
||||
url: "/vault/configs",
|
||||
config: {
|
||||
rateLimit: writeLimit
|
||||
},
|
||||
schema: {
|
||||
body: z.object({
|
||||
connectionId: z.string(),
|
||||
namespace: z.string()
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
config: z.object({
|
||||
id: z.string(),
|
||||
orgId: z.string(),
|
||||
namespace: z.string(),
|
||||
connectionId: z.string().nullable().optional(),
|
||||
createdAt: z.date(),
|
||||
updatedAt: z.date()
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const config = await server.services.migration.createVaultExternalMigration({
|
||||
...req.body,
|
||||
actor: req.permission
|
||||
});
|
||||
|
||||
return { config };
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "PUT",
|
||||
url: "/vault/configs/:id",
|
||||
config: {
|
||||
rateLimit: writeLimit
|
||||
},
|
||||
schema: {
|
||||
params: z.object({
|
||||
id: z.string()
|
||||
}),
|
||||
body: z.object({
|
||||
connectionId: z.string(),
|
||||
namespace: z.string()
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
config: z.object({
|
||||
id: z.string(),
|
||||
orgId: z.string(),
|
||||
namespace: z.string(),
|
||||
connectionId: z.string().nullable().optional(),
|
||||
createdAt: z.date(),
|
||||
updatedAt: z.date()
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const config = await server.services.migration.updateVaultExternalMigration({
|
||||
id: req.params.id,
|
||||
...req.body,
|
||||
actor: req.permission
|
||||
});
|
||||
|
||||
return { config };
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "DELETE",
|
||||
url: "/vault/configs/:id",
|
||||
config: {
|
||||
rateLimit: writeLimit
|
||||
},
|
||||
schema: {
|
||||
params: z.object({
|
||||
id: z.string()
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
config: z.object({
|
||||
id: z.string(),
|
||||
orgId: z.string(),
|
||||
namespace: z.string(),
|
||||
connectionId: z.string().nullable().optional(),
|
||||
createdAt: z.date(),
|
||||
updatedAt: z.date()
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const config = await server.services.migration.deleteVaultExternalMigration({
|
||||
id: req.params.id,
|
||||
actor: req.permission
|
||||
});
|
||||
|
||||
return { config };
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "GET",
|
||||
url: "/vault/namespaces",
|
||||
config: {
|
||||
rateLimit: readLimit
|
||||
},
|
||||
schema: {
|
||||
response: {
|
||||
200: z.object({
|
||||
namespaces: z.array(z.object({ id: z.string(), name: z.string() }))
|
||||
})
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const namespaces = await server.services.migration.getVaultNamespaces({
|
||||
actor: req.permission
|
||||
});
|
||||
|
||||
return { namespaces };
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "GET",
|
||||
url: "/vault/policies",
|
||||
config: {
|
||||
rateLimit: readLimit
|
||||
},
|
||||
schema: {
|
||||
querystring: z.object({
|
||||
namespace: z.string()
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
policies: z.array(z.object({ name: z.string(), rules: z.string() }))
|
||||
})
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const policies = await server.services.migration.getVaultPolicies({
|
||||
actor: req.permission,
|
||||
namespace: req.query.namespace
|
||||
});
|
||||
|
||||
return { policies };
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "GET",
|
||||
url: "/vault/mounts",
|
||||
config: {
|
||||
rateLimit: readLimit
|
||||
},
|
||||
schema: {
|
||||
querystring: z.object({
|
||||
namespace: z.string()
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
mounts: z.array(z.object({ path: z.string(), type: z.string(), version: z.string().nullish() }))
|
||||
})
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const mounts = await server.services.migration.getVaultMounts({
|
||||
actor: req.permission,
|
||||
namespace: req.query.namespace
|
||||
});
|
||||
|
||||
return { mounts };
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "GET",
|
||||
url: "/vault/auth-mounts",
|
||||
config: {
|
||||
rateLimit: readLimit
|
||||
},
|
||||
schema: {
|
||||
querystring: z.object({
|
||||
namespace: z.string(),
|
||||
authType: z.string().optional()
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
mounts: z.array(z.object({ path: z.string(), type: z.string() }))
|
||||
})
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const mounts = await server.services.migration.getVaultAuthMounts({
|
||||
actor: req.permission,
|
||||
namespace: req.query.namespace,
|
||||
authType: req.query.authType
|
||||
});
|
||||
|
||||
return { mounts };
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "POST",
|
||||
url: "/vault/import-secrets",
|
||||
config: {
|
||||
rateLimit: writeLimit
|
||||
},
|
||||
schema: {
|
||||
body: z.object({
|
||||
projectId: z.string(),
|
||||
environment: z.string(),
|
||||
secretPath: z.string(),
|
||||
vaultNamespace: z.string(),
|
||||
vaultSecretPath: z.string()
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
status: z.nativeEnum(VaultImportStatus)
|
||||
})
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const result = await server.services.migration.importVaultSecrets({
|
||||
actor: req.permission,
|
||||
auditLogInfo: req.auditLogInfo,
|
||||
...req.body
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "GET",
|
||||
url: "/vault/secret-paths",
|
||||
config: {
|
||||
rateLimit: readLimit
|
||||
},
|
||||
schema: {
|
||||
querystring: z.object({
|
||||
namespace: z.string(),
|
||||
mountPath: z.string()
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
secretPaths: z.string().array()
|
||||
})
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const secretPaths = await server.services.migration.getVaultSecretPaths({
|
||||
actor: req.permission,
|
||||
namespace: req.query.namespace,
|
||||
mountPath: req.query.mountPath
|
||||
});
|
||||
|
||||
return { secretPaths };
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "GET",
|
||||
url: "/vault/auth-roles/kubernetes",
|
||||
config: {
|
||||
rateLimit: readLimit
|
||||
},
|
||||
schema: {
|
||||
querystring: z.object({
|
||||
namespace: z.string(),
|
||||
mountPath: z.string()
|
||||
}),
|
||||
|
||||
response: {
|
||||
200: z.object({
|
||||
roles: z.array(
|
||||
z.object({
|
||||
name: z.string(),
|
||||
mountPath: z.string(),
|
||||
bound_service_account_names: z.array(z.string()),
|
||||
bound_service_account_namespaces: z.array(z.string()),
|
||||
token_ttl: z.number().optional(),
|
||||
token_max_ttl: z.number().optional(),
|
||||
token_policies: z.array(z.string()).optional(),
|
||||
token_bound_cidrs: z.array(z.string()).optional(),
|
||||
token_explicit_max_ttl: z.number().optional(),
|
||||
token_no_default_policy: z.boolean().optional(),
|
||||
token_num_uses: z.number().optional(),
|
||||
token_period: z.number().optional(),
|
||||
token_type: z.string().optional(),
|
||||
audience: z.string().optional(),
|
||||
alias_name_source: z.string().optional(),
|
||||
config: z.object({
|
||||
kubernetes_host: z.string(),
|
||||
kubernetes_ca_cert: z.string().optional(),
|
||||
issuer: z.string().optional(),
|
||||
disable_iss_validation: z.boolean().optional(),
|
||||
disable_local_ca_jwt: z.boolean().optional()
|
||||
})
|
||||
})
|
||||
)
|
||||
})
|
||||
}
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const roles = await server.services.migration.getVaultKubernetesAuthRoles({
|
||||
actor: req.permission,
|
||||
namespace: req.query.namespace,
|
||||
mountPath: req.query.mountPath
|
||||
});
|
||||
|
||||
return { roles };
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user