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
validate if super admin before changing super admin identity
Thiago Araujo da Silvac00164721d5b
diff --git a/backend/src/server/routes/v1/identity-alicloud-auth-router.ts b/backend/src/server/routes/v1/identity-alicloud-auth-router.tsindex cdfa556023..6826bbe6be 100644--- a/backend/src/server/routes/v1/identity-alicloud-auth-router.ts+++ b/backend/src/server/routes/v1/identity-alicloud-auth-router.ts@@ -335,7 +335,8 @@ export const registerIdentityAliCloudAuthRouter = async (server: FastifyZodProviactorOrgId: req.permission.orgId,...req.body,identityId: req.params.identityId,- allowedArns: req.body.allowedArns+ allowedArns: req.body.allowedArns,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({@@ -454,7 +455,8 @@ export const registerIdentityAliCloudAuthRouter = async (server: FastifyZodProviactorId: req.permission.id,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({diff --git a/backend/src/server/routes/v1/identity-aws-iam-auth-router.ts b/backend/src/server/routes/v1/identity-aws-iam-auth-router.tsindex 1738f53795..244ce55682 100644--- a/backend/src/server/routes/v1/identity-aws-iam-auth-router.ts+++ b/backend/src/server/routes/v1/identity-aws-iam-auth-router.ts@@ -296,7 +296,8 @@ export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider)actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,...req.body,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({@@ -417,7 +418,8 @@ export const registerIdentityAwsAuthRouter = async (server: FastifyZodProvider)actorId: req.permission.id,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({diff --git a/backend/src/server/routes/v1/identity-azure-auth-router.ts b/backend/src/server/routes/v1/identity-azure-auth-router.tsindex c8e1790e65..4fe183c77d 100644--- a/backend/src/server/routes/v1/identity-azure-auth-router.ts+++ b/backend/src/server/routes/v1/identity-azure-auth-router.ts@@ -297,7 +297,8 @@ export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvideractorOrgId: req.permission.orgId,actorAuthMethod: req.permission.authMethod,...req.body,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({@@ -418,7 +419,8 @@ export const registerIdentityAzureAuthRouter = async (server: FastifyZodProvideractorId: req.permission.id,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({diff --git a/backend/src/server/routes/v1/identity-gcp-auth-router.ts b/backend/src/server/routes/v1/identity-gcp-auth-router.tsindex 08b8a9a501..1905f62497 100644--- a/backend/src/server/routes/v1/identity-gcp-auth-router.ts+++ b/backend/src/server/routes/v1/identity-gcp-auth-router.ts@@ -289,7 +289,8 @@ export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider)actorOrgId: req.permission.orgId,actorAuthMethod: req.permission.authMethod,...req.body,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({@@ -412,7 +413,8 @@ export const registerIdentityGcpAuthRouter = async (server: FastifyZodProvider)actorId: req.permission.id,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({diff --git a/backend/src/server/routes/v1/identity-jwt-auth-router.ts b/backend/src/server/routes/v1/identity-jwt-auth-router.tsindex b415f15b19..a62a88eb4b 100644--- a/backend/src/server/routes/v1/identity-jwt-auth-router.ts+++ b/backend/src/server/routes/v1/identity-jwt-auth-router.ts@@ -317,7 +317,8 @@ export const registerIdentityJwtAuthRouter = async (server: FastifyZodProvider)actorOrgId: req.permission.orgId,actorAuthMethod: req.permission.authMethod,...req.body,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({@@ -447,7 +448,8 @@ export const registerIdentityJwtAuthRouter = async (server: FastifyZodProvider)actorId: req.permission.id,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({diff --git a/backend/src/server/routes/v1/identity-kubernetes-auth-router.ts b/backend/src/server/routes/v1/identity-kubernetes-auth-router.tsindex d099c0c800..5e339e242d 100644--- a/backend/src/server/routes/v1/identity-kubernetes-auth-router.ts+++ b/backend/src/server/routes/v1/identity-kubernetes-auth-router.ts@@ -471,7 +471,8 @@ export const registerIdentityKubernetesRouter = async (server: FastifyZodProvideactorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,...req.body,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({@@ -596,7 +597,8 @@ export const registerIdentityKubernetesRouter = async (server: FastifyZodProvideactorId: req.permission.id,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({diff --git a/backend/src/server/routes/v1/identity-ldap-auth-router.ts b/backend/src/server/routes/v1/identity-ldap-auth-router.tsindex 725c407000..40bc13299e 100644--- a/backend/src/server/routes/v1/identity-ldap-auth-router.ts+++ b/backend/src/server/routes/v1/identity-ldap-auth-router.ts@@ -568,7 +568,8 @@ export const registerIdentityLdapAuthRouter = async (server: FastifyZodProvider)actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,...req.body,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({@@ -707,7 +708,8 @@ export const registerIdentityLdapAuthRouter = async (server: FastifyZodProvider)actorId: req.permission.id,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({diff --git a/backend/src/server/routes/v1/identity-oci-auth-router.ts b/backend/src/server/routes/v1/identity-oci-auth-router.tsindex 05a41994c3..3ce8d58afe 100644--- a/backend/src/server/routes/v1/identity-oci-auth-router.ts+++ b/backend/src/server/routes/v1/identity-oci-auth-router.ts@@ -301,7 +301,8 @@ export const registerIdentityOciAuthRouter = async (server: FastifyZodProvider)actorOrgId: req.permission.orgId,...req.body,identityId: req.params.identityId,- allowedUsernames: req.body.allowedUsernames || null+ allowedUsernames: req.body.allowedUsernames || null,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({@@ -421,7 +422,8 @@ export const registerIdentityOciAuthRouter = async (server: FastifyZodProvider)actorId: req.permission.id,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({diff --git a/backend/src/server/routes/v1/identity-oidc-auth-router.ts b/backend/src/server/routes/v1/identity-oidc-auth-router.tsindex 43e7c5f738..1e48e74094 100644--- a/backend/src/server/routes/v1/identity-oidc-auth-router.ts+++ b/backend/src/server/routes/v1/identity-oidc-auth-router.ts@@ -335,7 +335,8 @@ export const registerIdentityOidcAuthRouter = async (server: FastifyZodProvider)actorOrgId: req.permission.orgId,actorAuthMethod: req.permission.authMethod,...req.body,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({@@ -463,7 +464,8 @@ export const registerIdentityOidcAuthRouter = async (server: FastifyZodProvider)actorId: req.permission.id,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({diff --git a/backend/src/server/routes/v1/identity-spiffe-auth-router.ts b/backend/src/server/routes/v1/identity-spiffe-auth-router.tsindex c540bf51d2..1ff004b810 100644--- a/backend/src/server/routes/v1/identity-spiffe-auth-router.ts+++ b/backend/src/server/routes/v1/identity-spiffe-auth-router.ts@@ -288,7 +288,8 @@ export const registerIdentitySpiffeAuthRouter = async (server: FastifyZodProvideactorOrgId: req.permission.orgId,actorAuthMethod: req.permission.authMethod,...req.body,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({@@ -446,7 +447,8 @@ export const registerIdentitySpiffeAuthRouter = async (server: FastifyZodProvideactorId: req.permission.id,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({diff --git a/backend/src/server/routes/v1/identity-tls-cert-auth-router.ts b/backend/src/server/routes/v1/identity-tls-cert-auth-router.tsindex 509c4feca6..00ccbc7c34 100644--- a/backend/src/server/routes/v1/identity-tls-cert-auth-router.ts+++ b/backend/src/server/routes/v1/identity-tls-cert-auth-router.ts@@ -406,7 +406,8 @@ export const registerIdentityTlsCertAuthRouter = async (server: FastifyZodProvidactorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,...req.body,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});const tlsCertAuthResponse = toTlsCertAuthResponse(identityTlsCertAuth);@@ -533,7 +534,8 @@ export const registerIdentityTlsCertAuthRouter = async (server: FastifyZodProvidactorId: req.permission.id,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});const tlsCertAuthResponse = toTlsCertAuthResponse(identityTlsCertAuth);diff --git a/backend/src/server/routes/v1/identity-universal-auth-router.ts b/backend/src/server/routes/v1/identity-universal-auth-router.tsindex de1eeb4424..a1bfd2e9df 100644--- a/backend/src/server/routes/v1/identity-universal-auth-router.ts+++ b/backend/src/server/routes/v1/identity-universal-auth-router.ts@@ -377,7 +377,8 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {actorOrgId: req.permission.orgId,actorAuthMethod: req.permission.authMethod,...req.body,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({@@ -501,7 +502,8 @@ export const registerIdentityUaRouter = async (server: FastifyZodProvider) => {actorId: req.permission.id,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,- identityId: req.params.identityId+ identityId: req.params.identityId,+ isActorSuperAdmin: isSuperAdmin(req.auth)});await server.services.auditLog.createAuditLog({diff --git a/backend/src/services/identity-alicloud-auth/identity-alicloud-auth-service.ts b/backend/src/services/identity-alicloud-auth/identity-alicloud-auth-service.tsindex ed44f723b8..346550affa 100644--- a/backend/src/services/identity-alicloud-auth/identity-alicloud-auth-service.ts+++ b/backend/src/services/identity-alicloud-auth/identity-alicloud-auth-service.ts@@ -371,8 +371,11 @@ export const identityAliCloudAuthServiceFactory = ({actorId,actorAuthMethod,actor,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TUpdateAliCloudAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,@@ -515,8 +518,11 @@ export const identityAliCloudAuthServiceFactory = ({actorId,actor,actorAuthMethod,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TRevokeAliCloudAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,diff --git a/backend/src/services/identity-alicloud-auth/identity-alicloud-auth-types.ts b/backend/src/services/identity-alicloud-auth/identity-alicloud-auth-types.tsindex 2363ce66c9..e0e9e54391 100644--- a/backend/src/services/identity-alicloud-auth/identity-alicloud-auth-types.ts+++ b/backend/src/services/identity-alicloud-auth/identity-alicloud-auth-types.ts@@ -31,6 +31,7 @@ export type TUpdateAliCloudAuthDTO = {accessTokenMaxTTL?: number;accessTokenNumUsesLimit?: number;accessTokenTrustedIps?: { ipAddress: string }[];+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TGetAliCloudAuthDTO = {@@ -39,6 +40,7 @@ export type TGetAliCloudAuthDTO = {export type TRevokeAliCloudAuthDTO = {identityId: string;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TAliCloudGetUserResponse = {diff --git a/backend/src/services/identity-aws-auth/identity-aws-auth-service.ts b/backend/src/services/identity-aws-auth/identity-aws-auth-service.tsindex 779106f11b..dcbe27dd07 100644--- a/backend/src/services/identity-aws-auth/identity-aws-auth-service.ts+++ b/backend/src/services/identity-aws-auth/identity-aws-auth-service.ts@@ -473,8 +473,11 @@ export const identityAwsAuthServiceFactory = ({actorId,actorAuthMethod,actor,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TUpdateAwsAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,@@ -618,8 +621,11 @@ export const identityAwsAuthServiceFactory = ({actorId,actor,actorAuthMethod,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TRevokeAwsAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,diff --git a/backend/src/services/identity-aws-auth/identity-aws-auth-types.ts b/backend/src/services/identity-aws-auth/identity-aws-auth-types.tsindex 8f3e0d9156..563b834bd7 100644--- a/backend/src/services/identity-aws-auth/identity-aws-auth-types.ts+++ b/backend/src/services/identity-aws-auth/identity-aws-auth-types.ts@@ -29,6 +29,7 @@ export type TUpdateAwsAuthDTO = {accessTokenMaxTTL?: number;accessTokenNumUsesLimit?: number;accessTokenTrustedIps?: { ipAddress: string }[];+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TGetAwsAuthDTO = {@@ -58,4 +59,5 @@ export type TGetCallerIdentityResponse = {export type TRevokeAwsAuthDTO = {identityId: string;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;diff --git a/backend/src/services/identity-azure-auth/identity-azure-auth-service.ts b/backend/src/services/identity-azure-auth/identity-azure-auth-service.tsindex 14a753b35e..081b70ad56 100644--- a/backend/src/services/identity-azure-auth/identity-azure-auth-service.ts+++ b/backend/src/services/identity-azure-auth/identity-azure-auth-service.ts@@ -374,8 +374,11 @@ export const identityAzureAuthServiceFactory = ({actorId,actorAuthMethod,actor,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TUpdateAzureAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,@@ -520,8 +523,11 @@ export const identityAzureAuthServiceFactory = ({actorId,actor,actorAuthMethod,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TRevokeAzureAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,diff --git a/backend/src/services/identity-azure-auth/identity-azure-auth-types.ts b/backend/src/services/identity-azure-auth/identity-azure-auth-types.tsindex 9f1854aca1..aa567917eb 100644--- a/backend/src/services/identity-azure-auth/identity-azure-auth-types.ts+++ b/backend/src/services/identity-azure-auth/identity-azure-auth-types.ts@@ -27,6 +27,7 @@ export type TUpdateAzureAuthDTO = {accessTokenMaxTTL?: number;accessTokenNumUsesLimit?: number;accessTokenTrustedIps?: { ipAddress: string }[];+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TGetAzureAuthDTO = {@@ -123,4 +124,5 @@ export type TDecodedAzureAuthJwt = {export type TRevokeAzureAuthDTO = {identityId: string;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;diff --git a/backend/src/services/identity-gcp-auth/identity-gcp-auth-service.ts b/backend/src/services/identity-gcp-auth/identity-gcp-auth-service.tsindex 63e7527a37..a8c807c84f 100644--- a/backend/src/services/identity-gcp-auth/identity-gcp-auth-service.ts+++ b/backend/src/services/identity-gcp-auth/identity-gcp-auth-service.ts@@ -420,8 +420,11 @@ export const identityGcpAuthServiceFactory = ({actorId,actorAuthMethod,actor,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TUpdateGcpAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,@@ -569,8 +572,11 @@ export const identityGcpAuthServiceFactory = ({actorId,actor,actorAuthMethod,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TRevokeGcpAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,diff --git a/backend/src/services/identity-gcp-auth/identity-gcp-auth-types.ts b/backend/src/services/identity-gcp-auth/identity-gcp-auth-types.tsindex c28611735c..8f16f2a6a7 100644--- a/backend/src/services/identity-gcp-auth/identity-gcp-auth-types.ts+++ b/backend/src/services/identity-gcp-auth/identity-gcp-auth-types.ts@@ -29,6 +29,7 @@ export type TUpdateGcpAuthDTO = {accessTokenMaxTTL?: number;accessTokenNumUsesLimit?: number;accessTokenTrustedIps?: { ipAddress: string }[];+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TGetGcpAuthDTO = {@@ -81,4 +82,5 @@ export type TDecodedGcpIamAuthJwt = {export type TRevokeGcpAuthDTO = {identityId: string;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;diff --git a/backend/src/services/identity-jwt-auth/identity-jwt-auth-service.ts b/backend/src/services/identity-jwt-auth/identity-jwt-auth-service.tsindex 70d3b7f0b9..fb1759427b 100644--- a/backend/src/services/identity-jwt-auth/identity-jwt-auth-service.ts+++ b/backend/src/services/identity-jwt-auth/identity-jwt-auth-service.ts@@ -567,8 +567,11 @@ export const identityJwtAuthServiceFactory = ({actorId,actorAuthMethod,actor,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TUpdateJwtAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,@@ -764,7 +767,16 @@ export const identityJwtAuthServiceFactory = ({};};- const revokeJwtAuth = async ({ identityId, actorId, actor, actorAuthMethod, actorOrgId }: TRevokeJwtAuthDTO) => {+ const revokeJwtAuth = async ({+ identityId,+ actorId,+ actor,+ actorAuthMethod,+ actorOrgId,+ isActorSuperAdmin+ }: TRevokeJwtAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,diff --git a/backend/src/services/identity-jwt-auth/identity-jwt-auth-types.ts b/backend/src/services/identity-jwt-auth/identity-jwt-auth-types.tsindex 341fae399f..e129094d58 100644--- a/backend/src/services/identity-jwt-auth/identity-jwt-auth-types.ts+++ b/backend/src/services/identity-jwt-auth/identity-jwt-auth-types.ts@@ -36,6 +36,7 @@ export type TUpdateJwtAuthDTO = {accessTokenMaxTTL?: number;accessTokenNumUsesLimit?: number;accessTokenTrustedIps?: { ipAddress: string }[];+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TGetJwtAuthDTO = {@@ -44,6 +45,7 @@ export type TGetJwtAuthDTO = {export type TRevokeJwtAuthDTO = {identityId: string;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TLoginJwtAuthDTO = {diff --git a/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-service.ts b/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-service.tsindex e9777018f1..d45a042ab9 100644--- a/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-service.ts+++ b/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-service.ts@@ -1070,8 +1070,11 @@ export const identityKubernetesAuthServiceFactory = ({actorId,actorAuthMethod,actor,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TUpdateKubernetesAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,@@ -1495,8 +1498,11 @@ export const identityKubernetesAuthServiceFactory = ({actorId,actor,actorAuthMethod,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TRevokeKubernetesAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,diff --git a/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-types.ts b/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-types.tsindex 47d181f9d5..ad11fef5e1 100644--- a/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-types.ts+++ b/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-types.ts@@ -46,6 +46,7 @@ export type TUpdateKubernetesAuthDTO = {accessTokenMaxTTL?: number;accessTokenNumUsesLimit?: number;accessTokenTrustedIps?: { ipAddress: string }[];+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TGetKubernetesAuthDTO = {@@ -89,4 +90,5 @@ export type TKubernetesTokenRequest = {export type TRevokeKubernetesAuthDTO = {identityId: string;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;diff --git a/backend/src/services/identity-ldap-auth/identity-ldap-auth-service.ts b/backend/src/services/identity-ldap-auth/identity-ldap-auth-service.tsindex 6b35b7887c..d9ca10929d 100644--- a/backend/src/services/identity-ldap-auth/identity-ldap-auth-service.ts+++ b/backend/src/services/identity-ldap-auth/identity-ldap-auth-service.ts@@ -544,8 +544,11 @@ export const identityLdapAuthServiceFactory = ({lockoutEnabled,lockoutThreshold,lockoutDurationSeconds,- lockoutCounterResetSeconds+ lockoutCounterResetSeconds,+ isActorSuperAdmin}: TUpdateLdapAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,@@ -803,8 +806,11 @@ export const identityLdapAuthServiceFactory = ({actorId,actor,actorAuthMethod,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TRevokeLdapAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,diff --git a/backend/src/services/identity-ldap-auth/identity-ldap-auth-types.ts b/backend/src/services/identity-ldap-auth/identity-ldap-auth-types.tsindex 26e118073f..2778297bcc 100644--- a/backend/src/services/identity-ldap-auth/identity-ldap-auth-types.ts+++ b/backend/src/services/identity-ldap-auth/identity-ldap-auth-types.ts@@ -51,6 +51,7 @@ export type TUpdateLdapAuthDTO = {lockoutThreshold?: number;lockoutDurationSeconds?: number;lockoutCounterResetSeconds?: number;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TGetLdapAuthDTO = {@@ -64,6 +65,7 @@ export type TLoginLdapAuthDTO = {export type TRevokeLdapAuthDTO = {identityId: string;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TClearLdapAuthLockoutsDTO = {diff --git a/backend/src/services/identity-oci-auth/identity-oci-auth-service.ts b/backend/src/services/identity-oci-auth/identity-oci-auth-service.tsindex 9fdf5cd000..a29855998c 100644--- a/backend/src/services/identity-oci-auth/identity-oci-auth-service.ts+++ b/backend/src/services/identity-oci-auth/identity-oci-auth-service.ts@@ -386,8 +386,11 @@ export const identityOciAuthServiceFactory = ({actorId,actorAuthMethod,actor,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TUpdateOciAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,@@ -531,8 +534,11 @@ export const identityOciAuthServiceFactory = ({actorId,actor,actorAuthMethod,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TRevokeOciAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,diff --git a/backend/src/services/identity-oci-auth/identity-oci-auth-types.ts b/backend/src/services/identity-oci-auth/identity-oci-auth-types.tsindex 8c1d6d4826..bf5645b9d6 100644--- a/backend/src/services/identity-oci-auth/identity-oci-auth-types.ts+++ b/backend/src/services/identity-oci-auth/identity-oci-auth-types.ts@@ -31,6 +31,7 @@ export type TUpdateOciAuthDTO = {accessTokenMaxTTL?: number;accessTokenNumUsesLimit?: number;accessTokenTrustedIps?: { ipAddress: string }[];+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TGetOciAuthDTO = {@@ -39,6 +40,7 @@ export type TGetOciAuthDTO = {export type TRevokeOciAuthDTO = {identityId: string;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TOciGetUserResponse = {diff --git a/backend/src/services/identity-oidc-auth/identity-oidc-auth-service.ts b/backend/src/services/identity-oidc-auth/identity-oidc-auth-service.tsindex 4c71247c43..c075f49a1c 100644--- a/backend/src/services/identity-oidc-auth/identity-oidc-auth-service.ts+++ b/backend/src/services/identity-oidc-auth/identity-oidc-auth-service.ts@@ -728,8 +728,11 @@ export const identityOidcAuthServiceFactory = ({actorId,actorAuthMethod,actor,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TUpdateOidcAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,@@ -905,7 +908,16 @@ export const identityOidcAuthServiceFactory = ({return { ...identityOidcAuth, orgId: identityMembershipOrg.scopeOrgId, caCert };};- const revokeOidcAuth = async ({ identityId, actorId, actor, actorAuthMethod, actorOrgId }: TRevokeOidcAuthDTO) => {+ const revokeOidcAuth = async ({+ identityId,+ actorId,+ actor,+ actorAuthMethod,+ actorOrgId,+ isActorSuperAdmin+ }: TRevokeOidcAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,diff --git a/backend/src/services/identity-oidc-auth/identity-oidc-auth-types.ts b/backend/src/services/identity-oidc-auth/identity-oidc-auth-types.tsindex 5904151afd..a5eca0bac6 100644--- a/backend/src/services/identity-oidc-auth/identity-oidc-auth-types.ts+++ b/backend/src/services/identity-oidc-auth/identity-oidc-auth-types.ts@@ -29,6 +29,7 @@ export type TUpdateOidcAuthDTO = {accessTokenMaxTTL?: number;accessTokenNumUsesLimit?: number;accessTokenTrustedIps?: { ipAddress: string }[];+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TGetOidcAuthDTO = {@@ -43,4 +44,5 @@ export type TLoginOidcAuthDTO = {export type TRevokeOidcAuthDTO = {identityId: string;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;diff --git a/backend/src/services/identity-spiffe-auth/identity-spiffe-auth-service.ts b/backend/src/services/identity-spiffe-auth/identity-spiffe-auth-service.tsindex ffc87d9249..79a29c8f15 100644--- a/backend/src/services/identity-spiffe-auth/identity-spiffe-auth-service.ts+++ b/backend/src/services/identity-spiffe-auth/identity-spiffe-auth-service.ts@@ -650,8 +650,11 @@ export const identitySpiffeAuthServiceFactory = ({actorId,actorAuthMethod,actor,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TUpdateSpiffeAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,@@ -859,8 +862,11 @@ export const identitySpiffeAuthServiceFactory = ({actorId,actor,actorAuthMethod,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TRevokeSpiffeAuthDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,diff --git a/backend/src/services/identity-spiffe-auth/identity-spiffe-auth-types.ts b/backend/src/services/identity-spiffe-auth/identity-spiffe-auth-types.tsindex bb582db74f..9a346c4d32 100644--- a/backend/src/services/identity-spiffe-auth/identity-spiffe-auth-types.ts+++ b/backend/src/services/identity-spiffe-auth/identity-spiffe-auth-types.ts@@ -74,6 +74,7 @@ export type TUpdateSpiffeAuthDTO = {accessTokenMaxTTL?: number;accessTokenNumUsesLimit?: number;accessTokenTrustedIps?: { ipAddress: string }[];+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TGetSpiffeAuthDTO = {@@ -82,4 +83,5 @@ export type TGetSpiffeAuthDTO = {export type TRevokeSpiffeAuthDTO = {identityId: string;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;diff --git a/backend/src/services/identity-tls-cert-auth/identity-tls-cert-auth-service.ts b/backend/src/services/identity-tls-cert-auth/identity-tls-cert-auth-service.tsindex 8869b0cbaf..9a27bb9c66 100644--- a/backend/src/services/identity-tls-cert-auth/identity-tls-cert-auth-service.ts+++ b/backend/src/services/identity-tls-cert-auth/identity-tls-cert-auth-service.ts@@ -505,8 +505,11 @@ export const identityTlsCertAuthServiceFactory = ({actorId,actorAuthMethod,actor,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,@@ -675,8 +678,11 @@ export const identityTlsCertAuthServiceFactory = ({actorId,actor,actorAuthMethod,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,diff --git a/backend/src/services/identity-tls-cert-auth/identity-tls-cert-auth-types.ts b/backend/src/services/identity-tls-cert-auth/identity-tls-cert-auth-types.tsindex 1d6239cb81..48a7d83739 100644--- a/backend/src/services/identity-tls-cert-auth/identity-tls-cert-auth-types.ts+++ b/backend/src/services/identity-tls-cert-auth/identity-tls-cert-auth-types.ts@@ -30,6 +30,7 @@ export type TUpdateTlsCertAuthDTO = {accessTokenMaxTTL?: number;accessTokenNumUsesLimit?: number;accessTokenTrustedIps?: { ipAddress: string }[];+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TGetTlsCertAuthDTO = {@@ -38,6 +39,7 @@ export type TGetTlsCertAuthDTO = {export type TRevokeTlsCertAuthDTO = {identityId: string;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TIdentityTlsCertAuthServiceFactory = {diff --git a/backend/src/services/identity-ua/identity-ua-service.ts b/backend/src/services/identity-ua/identity-ua-service.tsindex 2e5afc28d7..205aad0cf2 100644--- a/backend/src/services/identity-ua/identity-ua-service.ts+++ b/backend/src/services/identity-ua/identity-ua-service.ts@@ -576,8 +576,11 @@ export const identityUaServiceFactory = ({lockoutEnabled,lockoutThreshold,lockoutDurationSeconds,- lockoutCounterResetSeconds+ lockoutCounterResetSeconds,+ isActorSuperAdmin}: TUpdateUaDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,@@ -749,8 +752,11 @@ export const identityUaServiceFactory = ({actorId,actor,actorAuthMethod,- actorOrgId+ actorOrgId,+ isActorSuperAdmin}: TRevokeUaDTO) => {+ await validateIdentityUpdateForSuperAdminPrivileges(identityId, isActorSuperAdmin);+const identityMembershipOrg = await membershipIdentityDAL.getIdentityById({scopeData: {scope: AccessScope.Organization,diff --git a/backend/src/services/identity-ua/identity-ua-types.ts b/backend/src/services/identity-ua/identity-ua-types.tsindex 2bf739be8d..4a98a766e1 100644--- a/backend/src/services/identity-ua/identity-ua-types.ts+++ b/backend/src/services/identity-ua/identity-ua-types.ts@@ -39,6 +39,7 @@ export type TUpdateUaDTO = {lockoutThreshold?: number;lockoutDurationSeconds?: number;lockoutCounterResetSeconds?: number;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TGetUaDTO = {@@ -47,6 +48,7 @@ export type TGetUaDTO = {export type TRevokeUaDTO = {identityId: string;+ isActorSuperAdmin?: boolean;} & Omit<TProjectPermission, "projectId">;export type TCreateUaClientSecretDTO = {diff --git a/frontend/src/pages/organization/RoleByIDPage/components/OrgRoleModifySection.utils.ts b/frontend/src/pages/organization/RoleByIDPage/components/OrgRoleModifySection.utils.tsindex d48f96906d..49f5581291 100644--- a/frontend/src/pages/organization/RoleByIDPage/components/OrgRoleModifySection.utils.ts+++ b/frontend/src/pages/organization/RoleByIDPage/components/OrgRoleModifySection.utils.ts@@ -632,7 +632,7 @@ export const ORG_PERMISSION_OBJECT: Record<string, TOrgPermissionConfig> = {},{value: OrgPermissionIdentityActions.EditAuth,- label: "Configure Auth Methods",+ label: "Configure Auth",description: "Add or update authentication methods for a machine identity"},{