Skip to content

Commit

Permalink
Don't stop parsing the auth list at the first PUBLIC auth method
Browse files Browse the repository at this point in the history
  • Loading branch information
matyasselmeci committed Nov 8, 2023
1 parent 04ff88d commit fe3ecb3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/webapp/data_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def __init__(
self.credential_generation = credential_generation

def is_public(self) -> bool:
return self.authz_list and self.authz_list[0].is_public
return any(x for x in self.authz_list if x.is_public)


def _parse_authz_scitokens(attributes: Dict, authz: Dict) -> Tuple[AuthMethod, Optional[str]]:
Expand Down Expand Up @@ -392,8 +392,5 @@ def parse_authz_list(self, path: str, unparsed_authz_list: List[Union[str, Dict]
if err:
self.errors.add(f"Namespace {path}: {err}")
continue
if parsed_authz.is_public:
return [parsed_authz]
else:
authz_list.append(parsed_authz)
authz_list.append(parsed_authz)
return authz_list

0 comments on commit fe3ecb3

Please sign in to comment.