Skip to content

Stop using deprecated group membership APIs #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
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