mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 11:27:07 +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: {
|
config: {
|
||||||
rateLimit: writeLimit
|
rateLimit: writeLimit
|
||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
schema: {
|
schema: {
|
||||||
tags: [ApiDocsTags.Identities],
|
tags: [ApiDocsTags.Identities],
|
||||||
description: "Create an identity in a project",
|
description: "Create an identity in a project",
|
||||||
@@ -102,7 +102,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
|
|||||||
config: {
|
config: {
|
||||||
rateLimit: writeLimit
|
rateLimit: writeLimit
|
||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
schema: {
|
schema: {
|
||||||
tags: [ApiDocsTags.Identities],
|
tags: [ApiDocsTags.Identities],
|
||||||
description: "Update an identity in a project",
|
description: "Update an identity in a project",
|
||||||
@@ -168,7 +168,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
|
|||||||
config: {
|
config: {
|
||||||
rateLimit: writeLimit
|
rateLimit: writeLimit
|
||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
schema: {
|
schema: {
|
||||||
tags: [ApiDocsTags.Identities],
|
tags: [ApiDocsTags.Identities],
|
||||||
description: "Delete an identity from a project",
|
description: "Delete an identity from a project",
|
||||||
@@ -221,7 +221,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
|
|||||||
config: {
|
config: {
|
||||||
rateLimit: readLimit
|
rateLimit: readLimit
|
||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
schema: {
|
schema: {
|
||||||
tags: [ApiDocsTags.Identities],
|
tags: [ApiDocsTags.Identities],
|
||||||
description: "Get an identity by ID in a project",
|
description: "Get an identity by ID in a project",
|
||||||
@@ -263,7 +263,7 @@ export const registerProjectIdentityRouter = async (server: FastifyZodProvider)
|
|||||||
config: {
|
config: {
|
||||||
rateLimit: readLimit
|
rateLimit: readLimit
|
||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
schema: {
|
schema: {
|
||||||
tags: [ApiDocsTags.Identities],
|
tags: [ApiDocsTags.Identities],
|
||||||
description: "List identities in a project",
|
description: "List identities in a project",
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ export const identityAccessTokenServiceFactory = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!identityOrgMembership) {
|
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;
|
orgId = subOrganization.id;
|
||||||
orgName = subOrganization.name;
|
orgName = subOrganization.name;
|
||||||
@@ -241,7 +241,7 @@ export const identityAccessTokenServiceFactory = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!identityOrgMembership) {
|
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;
|
orgId = identityOrgDetails.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user