mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 09:26:47 +00:00
Merge pull request #3310 from Infisical/misc/reordered-ua-checks-for-crossplane
misc: reordered ua checks for crossplane
This commit is contained in:
@@ -253,14 +253,17 @@ export const identityUaServiceFactory = ({
|
|||||||
const identityMembershipOrg = await identityOrgMembershipDAL.findOne({ identityId });
|
const identityMembershipOrg = await identityOrgMembershipDAL.findOne({ identityId });
|
||||||
if (!identityMembershipOrg) throw new NotFoundError({ message: `Failed to find identity with ID ${identityId}` });
|
if (!identityMembershipOrg) throw new NotFoundError({ message: `Failed to find identity with ID ${identityId}` });
|
||||||
|
|
||||||
|
const uaIdentityAuth = await identityUaDAL.findOne({ identityId });
|
||||||
|
if (!uaIdentityAuth) {
|
||||||
|
throw new NotFoundError({ message: `Failed to find universal auth for identity with ID ${identityId}` });
|
||||||
|
}
|
||||||
|
|
||||||
if (!identityMembershipOrg.identity.authMethods.includes(IdentityAuthMethod.UNIVERSAL_AUTH)) {
|
if (!identityMembershipOrg.identity.authMethods.includes(IdentityAuthMethod.UNIVERSAL_AUTH)) {
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: "The identity does not have universal auth"
|
message: "The identity does not have universal auth"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const uaIdentityAuth = await identityUaDAL.findOne({ identityId });
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(accessTokenMaxTTL || uaIdentityAuth.accessTokenMaxTTL) > 0 &&
|
(accessTokenMaxTTL || uaIdentityAuth.accessTokenMaxTTL) > 0 &&
|
||||||
(accessTokenTTL || uaIdentityAuth.accessTokenMaxTTL) > (accessTokenMaxTTL || uaIdentityAuth.accessTokenMaxTTL)
|
(accessTokenTTL || uaIdentityAuth.accessTokenMaxTTL) > (accessTokenMaxTTL || uaIdentityAuth.accessTokenMaxTTL)
|
||||||
@@ -329,14 +332,17 @@ export const identityUaServiceFactory = ({
|
|||||||
const identityMembershipOrg = await identityOrgMembershipDAL.findOne({ identityId });
|
const identityMembershipOrg = await identityOrgMembershipDAL.findOne({ identityId });
|
||||||
if (!identityMembershipOrg) throw new NotFoundError({ message: `Failed to find identity with ID ${identityId}` });
|
if (!identityMembershipOrg) throw new NotFoundError({ message: `Failed to find identity with ID ${identityId}` });
|
||||||
|
|
||||||
|
const uaIdentityAuth = await identityUaDAL.findOne({ identityId });
|
||||||
|
if (!uaIdentityAuth) {
|
||||||
|
throw new NotFoundError({ message: `Failed to find universal auth for identity with ID ${identityId}` });
|
||||||
|
}
|
||||||
|
|
||||||
if (!identityMembershipOrg.identity.authMethods.includes(IdentityAuthMethod.UNIVERSAL_AUTH)) {
|
if (!identityMembershipOrg.identity.authMethods.includes(IdentityAuthMethod.UNIVERSAL_AUTH)) {
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: "The identity does not have universal auth"
|
message: "The identity does not have universal auth"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const uaIdentityAuth = await identityUaDAL.findOne({ identityId });
|
|
||||||
|
|
||||||
const { permission } = await permissionService.getOrgPermission(
|
const { permission } = await permissionService.getOrgPermission(
|
||||||
actor,
|
actor,
|
||||||
actorId,
|
actorId,
|
||||||
|
|||||||
Reference in New Issue
Block a user