Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: allow not expanding personal overrides from get secret by name router

Daniel Hougaard6d8ef3cec73c
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index 7d14027137..c2069a0f72 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -1283,7 +1283,9 @@ export const RAW_SECRETS = {
version: "The version of the secret to get.",
type: "The type of the secret to get.",
viewSecretValue: "Whether or not to retrieve the secret value.",
- includeImports: "Weather to include imported secrets or not."
+ includeImports: "Weather to include imported secrets or not.",
+ includePersonalOverrides:
+ "Whether or not to include personal secrets in the response. When enabled, personal secrets will take priority over shared secrets with the same key."
},
UPDATE: {
secretName: "The name of the secret to update.",
diff --git a/backend/src/server/routes/v4/secret-router.ts b/backend/src/server/routes/v4/secret-router.ts
index 32e7358159..3de7dfab75 100644
--- a/backend/src/server/routes/v4/secret-router.ts
+++ b/backend/src/server/routes/v4/secret-router.ts
@@ -313,7 +313,8 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
type: z.nativeEnum(SecretType).default(SecretType.Shared).describe(RAW_SECRETS.GET.type),
viewSecretValue: convertStringBoolean(true).describe(RAW_SECRETS.GET.viewSecretValue),
expandSecretReferences: convertStringBoolean(true).describe(RAW_SECRETS.GET.expand),
- includeImports: convertStringBoolean(true).describe(RAW_SECRETS.GET.includeImports)
+ includeImports: convertStringBoolean(true).describe(RAW_SECRETS.GET.includeImports),
+ includePersonalOverrides: convertStringBoolean(true).describe(RAW_SECRETS.GET.includePersonalOverrides)
}),
response: {
200: z.object({
@@ -350,7 +351,7 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
actorAuthMethod: req.permission.authMethod,
actorOrgId: req.permission.orgId,
expandSecretReferences: req.query.expandSecretReferences,
- expandPersonalOverrides: true,
+ expandPersonalOverrides: req.query.includePersonalOverrides,
environment,
projectId,
viewSecretValue: req.query.viewSecretValue,
diff --git a/backend/src/services/secret/secret-service.ts b/backend/src/services/secret/secret-service.ts
index db5c7c6e55..beecb5dd52 100644
--- a/backend/src/services/secret/secret-service.ts
+++ b/backend/src/services/secret/secret-service.ts
@@ -1604,8 +1604,7 @@ export const secretServiceFactory = ({
actorAuthMethod,
secretName,
includeImports,
- version,
- includePersonalOverrides
+ version
}: TGetASecretRawDTO) => {
const { botKey, shouldUseSecretV2Bridge } = await projectBotService.getBotKey(projectId);
if (shouldUseSecretV2Bridge) {