Skip to content

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

feat: added identity access token to project identity router

=1ef39f69615f
diff --git a/backend/src/server/routes/v1/project-identity-router.ts b/backend/src/server/routes/v1/project-identity-router.ts
index 5d86965453..9807dd20d3 100644
--- a/backend/src/server/routes/v1/project-identity-router.ts
+++ b/backend/src/server/routes/v1/project-identity-router.ts
@@ -40,7 +40,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
config: {
rateLimit: writeLimit
},
- onRequest: verifyAuth([AuthMode.JWT]),
+ onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
schema: {
tags: [ApiDocsTags.Identities],
description: "Create an identity in a project",
@@ -102,7 +102,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
config: {
rateLimit: writeLimit
},
- onRequest: verifyAuth([AuthMode.JWT]),
+ onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
schema: {
tags: [ApiDocsTags.Identities],
description: "Update an identity in a project",
@@ -168,7 +168,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
config: {
rateLimit: writeLimit
},
- onRequest: verifyAuth([AuthMode.JWT]),
+ onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
schema: {
tags: [ApiDocsTags.Identities],
description: "Delete an identity from a project",
@@ -221,7 +221,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
config: {
rateLimit: readLimit
},
- onRequest: verifyAuth([AuthMode.JWT]),
+ onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
schema: {
tags: [ApiDocsTags.Identities],
description: "Get an identity by ID in a project",
@@ -263,7 +263,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
config: {
rateLimit: readLimit
},
- onRequest: verifyAuth([AuthMode.JWT]),
+ onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
schema: {
tags: [ApiDocsTags.Identities],
description: "List identities in a project",
diff --git a/backend/src/services/identity-access-token/identity-access-token-service.ts b/backend/src/services/identity-access-token/identity-access-token-service.ts
index 853c57fb10..244e98908f 100644
--- a/backend/src/services/identity-access-token/identity-access-token-service.ts
+++ b/backend/src/services/identity-access-token/identity-access-token-service.ts
@@ -227,7 +227,7 @@ export const identityAccessTokenServiceFactory = ({
});
if (!identityOrgMembership) {
- throw new BadRequestError({ message: "Identity does not belong to any organization" });
+ throw new BadRequestError({ message: "Identity does not belong to this organization" });
}
orgId = subOrganization.id;
orgName = subOrganization.name;
@@ -241,7 +241,7 @@ export const identityAccessTokenServiceFactory = ({
});
if (!identityOrgMembership) {
- throw new BadRequestError({ message: "Identity does not belong to any organization" });
+ throw new BadRequestError({ message: "Identity does not belong to this organization" });
}
orgId = identityOrgDetails.id;