mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 09:26:47 +00:00
fix: review changes
This commit is contained in:
@@ -417,7 +417,7 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
|||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
schema: {
|
schema: {
|
||||||
hide: false,
|
hide: true,
|
||||||
tags: [ApiDocsTags.TokenAuth],
|
tags: [ApiDocsTags.TokenAuth],
|
||||||
description: "Get token for machine identity with Token Auth",
|
description: "Get token for machine identity with Token Auth",
|
||||||
security: [
|
security: [
|
||||||
@@ -441,8 +441,7 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
|||||||
actor: req.permission.type,
|
actor: req.permission.type,
|
||||||
actorId: req.permission.id,
|
actorId: req.permission.id,
|
||||||
actorOrgId: req.permission.orgId,
|
actorOrgId: req.permission.orgId,
|
||||||
actorAuthMethod: req.permission.authMethod,
|
actorAuthMethod: req.permission.authMethod
|
||||||
isActorSuperAdmin: isSuperAdmin(req.auth)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await server.services.auditLog.createAuditLog({
|
await server.services.auditLog.createAuditLog({
|
||||||
@@ -493,8 +492,7 @@ export const registerIdentityTokenAuthRouter = async (server: FastifyZodProvider
|
|||||||
actor: req.permission.type,
|
actor: req.permission.type,
|
||||||
actorId: req.permission.id,
|
actorId: req.permission.id,
|
||||||
actorOrgId: req.permission.orgId,
|
actorOrgId: req.permission.orgId,
|
||||||
actorAuthMethod: req.permission.authMethod,
|
actorAuthMethod: req.permission.authMethod
|
||||||
isActorSuperAdmin: isSuperAdmin(req.auth)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await server.services.auditLog.createAuditLog({
|
await server.services.auditLog.createAuditLog({
|
||||||
|
|||||||
@@ -621,7 +621,6 @@ export const identityTokenAuthServiceFactory = ({
|
|||||||
|
|
||||||
const getTokenAuthTokenById = async ({
|
const getTokenAuthTokenById = async ({
|
||||||
tokenId,
|
tokenId,
|
||||||
isActorSuperAdmin,
|
|
||||||
actorId,
|
actorId,
|
||||||
actor,
|
actor,
|
||||||
actorAuthMethod,
|
actorAuthMethod,
|
||||||
@@ -644,8 +643,6 @@ export const identityTokenAuthServiceFactory = ({
|
|||||||
throw new NotFoundError({ message: `Failed to find identity with ID ${foundToken.identityId}` });
|
throw new NotFoundError({ message: `Failed to find identity with ID ${foundToken.identityId}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
await validateIdentityUpdateForSuperAdminPrivileges(foundToken.identityId, isActorSuperAdmin);
|
|
||||||
|
|
||||||
if (!identityMembershipOrg.identity.authMethods.includes(IdentityAuthMethod.TOKEN_AUTH)) {
|
if (!identityMembershipOrg.identity.authMethods.includes(IdentityAuthMethod.TOKEN_AUTH)) {
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: "The identity does not have Token Auth"
|
message: "The identity does not have Token Auth"
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ export type TGetTokenAuthTokensDTO = {
|
|||||||
|
|
||||||
export type TGetTokenAuthTokenByIdDTO = {
|
export type TGetTokenAuthTokenByIdDTO = {
|
||||||
tokenId: string;
|
tokenId: string;
|
||||||
isActorSuperAdmin?: boolean;
|
|
||||||
} & Omit<TProjectPermission, "projectId">;
|
} & Omit<TProjectPermission, "projectId">;
|
||||||
|
|
||||||
export type TUpdateTokenAuthTokenDTO = {
|
export type TUpdateTokenAuthTokenDTO = {
|
||||||
|
|||||||
Reference in New Issue
Block a user