mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat: added identity access token to project identity router
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user