Merge "Enforce scope mutual exclusion for system"

This commit is contained in:
Zuul 2022-12-20 22:37:30 +00:00 committed by Gerrit Code Review
commit c96b058212
1 changed files with 2 additions and 1 deletions

View File

@ -137,13 +137,14 @@ class Auth(BaseAuth):
mutual_exclusion = [bool(self.domain_id or self.domain_name),
bool(self.project_id or self.project_name),
bool(self.trust_id),
bool(self.system_scope),
bool(self.unscoped)]
if sum(mutual_exclusion) > 1:
raise exceptions.AuthorizationFailure(
message='Authentication cannot be scoped to multiple'
' targets. Pick one of: project, domain, '
'trust or unscoped')
'trust, system or unscoped')
if self.domain_id:
body['auth']['scope'] = {'domain': {'id': self.domain_id}}