Skip to content

Commit

Permalink
Stop using deprecated group membership APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiefMaster committed Dec 3, 2024
1 parent 47f495a commit 8edcf6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions flask_multipass_cern.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_members(self):
],
}
try:
results = self.provider._fetch_all(api_session, f'/api/v1.0/Group/{name}/memberidentities/precomputed',
results = self.provider._fetch_all(api_session, f'/api/v1.0/Group/{name}/members/identities/recursive',
params)[0]
except RequestException:
self.provider.logger.warning('Refreshing members failed for group %s', name)
Expand Down Expand Up @@ -425,7 +425,7 @@ def search_identities_ex(self, criteria, exact=False, limit=None):
def _fetch_identity_group_names(self, identifier):
with self._get_api_session() as api_session:
identifier = identifier.replace('/', '%2F') # edugain identifiers sometimes contain slashes
resp = api_session.get(f'{self.authz_api_base}/api/v1.0/IdentityMembership/{identifier}/precomputed')
resp = api_session.get(f'{self.authz_api_base}/api/v1.0/identity/{identifier}/groups/recursive')
if resp.status_code == 404:
return set()
resp.raise_for_status()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_request_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def faster_retries(monkeypatch):
@pytest.mark.usefixtures('httpretty_enabled', 'mock_get_api_session')
def test_get_identity_groups_retry(provider):
authz_api = provider.settings.get('authz_api')
test_uri = f'{authz_api}/api/v1.0/IdentityMembership/1/precomputed'
test_uri = f'{authz_api}/api/v1.0/identity/1/groups/recursive'
httpretty.register_uri(httpretty.GET, test_uri, status=503)

try:
Expand Down

0 comments on commit 8edcf6c

Please sign in to comment.