Skip to content
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

fix: missing server_metadata #7346

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions backend/common/corpora_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def get_defaults_template(self):
"internal_url": "{api_base_url}",
"issuer": [],
"retry_status_forcelist": [429, 500, 502, 503, 504],
"server_metadata_url": "{api_base_url}/.well-known/openid-configuration",
}
template["issuer"].append(self.api_base_url + "/" if not self.api_base_url.endswith("/") else self.api_base_url)
template["issuer"].append("https://" + self.auth0_domain + "/")
Expand Down
1 change: 1 addition & 0 deletions backend/portal/api/app/v1/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def get_oauth_client(config: CorporaAuthConfig) -> FlaskRemoteApp:
authorize_url=config.api_authorize_url,
client_kwargs={"scope": "openid profile email offline_access write:collections"},
authorize_params={"audience": config.api_audience},
server_metadata_url=config.server_metadata_url,
Bento007 marked this conversation as resolved.
Show resolved Hide resolved
)
return oauth_client

Expand Down
5 changes: 4 additions & 1 deletion tests/functional/backend/corpora/test_collection_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ def test_nocollection_access(session, api_url, nocollection_cookie):


def test_collection_access(session, api_url, supercurator_cookie, curator_cookie):
"""Test that only a super curator has access to all of the collections"""
"""Test that only a super curator has access to all of the collections
Note: Sometimes this fails if the rdev environment was not created properly. Rebuilding the rdev environment to fix.
"""
# get collection for supercurator user
headers = {"Cookie": f"cxguser={supercurator_cookie}", "Content-Type": "application/json"}
res = session.get(f"{api_url}/dp/v1/collections", headers=headers)
Expand Down
Loading