Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Update inject-identity.ts
Daniel Hougaard34618041ca6b
diff --git a/backend/src/server/plugins/auth/inject-identity.ts b/backend/src/server/plugins/auth/inject-identity.tsindex 11cb241177..a95fca4516 100644--- a/backend/src/server/plugins/auth/inject-identity.ts+++ b/backend/src/server/plugins/auth/inject-identity.ts@@ -99,7 +99,6 @@ export const injectIdentity = fp(async (server: FastifyZodProvider) => {if (!authMode) return;switch (authMode) {- // May or may not have an orgId. If it doesn't have an org ID, it's likely because the token is from an org that doesn't enforce org-level auth.case AuthMode.JWT: {const { user, tokenVersionId, orgId } = await server.services.authToken.fnValidateJwtIdentity(token);req.auth = { authMode: AuthMode.JWT, user, userId: user.id, tokenVersionId, actor, orgId };@@ -117,7 +116,6 @@ export const injectIdentity = fp(async (server: FastifyZodProvider) => {};break;}- // Will always contain an orgId.case AuthMode.SERVICE_TOKEN: {const serviceToken = await server.services.serviceToken.fnValidateServiceToken(token);req.auth = {@@ -128,13 +126,11 @@ export const injectIdentity = fp(async (server: FastifyZodProvider) => {};break;}- // Will never contain an orgId. API keys are not tied to an organization.case AuthMode.API_KEY: {const user = await server.services.apiKey.fnValidateApiKey(token as string);req.auth = { authMode: AuthMode.API_KEY as const, userId: user.id, actor, user };break;}- // OKcase AuthMode.SCIM_TOKEN: {const { orgId, scimTokenId } = await server.services.scim.fnValidateScimToken(token);req.auth = { authMode: AuthMode.SCIM_TOKEN, actor, scimTokenId, orgId };