Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions servers/zms/src/main/java/com/yahoo/athenz/zms/ZMSImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -4584,11 +4584,6 @@ void validateRoleStructure(final Role role, final String domainName, final Strin

if (!StringUtil.isEmpty(role.getTrust())) {

AthenzDomain athenzDomain = getAthenzDomain(role.getTrust(), true);
if (athenzDomain == null) {
throw ZMSUtils.requestError("Delegated role assigned to non existing domain", caller);
}

if (!ZMSUtils.isCollectionEmpty(role.getRoleMembers())) {
throw ZMSUtils.requestError("validateRoleMembers: Role cannot have both roleMembers and delegated domain set", caller);
}
Expand All @@ -4600,6 +4595,10 @@ void validateRoleStructure(final Role role, final String domainName, final Strin
if (domainName.equals(role.getTrust())) {
throw ZMSUtils.requestError("validateRoleMembers: Role cannot be delegated to itself", caller);
}

if (getAthenzDomain(role.getTrust(), true) == null) {
throw ZMSUtils.requestError("Delegated role assigned to non existing domain", caller);
}
}
}

Expand Down
Loading