Skip to content

feat: use issuer url instead of well known url#1371

Open
ZohebShaikh wants to merge 10 commits into
mainfrom
check-issuer
Open

feat: use issuer url instead of well known url#1371
ZohebShaikh wants to merge 10 commits into
mainfrom
check-issuer

Conversation

@ZohebShaikh

Copy link
Copy Markdown
Contributor

No description provided.

@ZohebShaikh ZohebShaikh changed the title add issuer instead of well known url feat: add issuer instead of well known url Feb 3, 2026
@codecov

codecov Bot commented Feb 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.23810% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.85%. Comparing base (dd3f40d) to head (98c8b50).

Files with missing lines Patch % Lines
src/blueapi/config.py 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1371      +/-   ##
==========================================
- Coverage   95.86%   95.85%   -0.02%     
==========================================
  Files          44       44              
  Lines        3292     3306      +14     
==========================================
+ Hits         3156     3169      +13     
- Misses        136      137       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/blueapi/config.py Outdated
@ZohebShaikh ZohebShaikh marked this pull request as ready for review February 3, 2026 14:05
@ZohebShaikh ZohebShaikh requested a review from a team as a code owner February 3, 2026 14:05
@ZohebShaikh ZohebShaikh changed the title feat: add issuer instead of well known url feat: use issuer url instead of well known url Feb 3, 2026

@tpoliaw tpoliaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change - it makes the auth config much clearer, thanks.

That said, this is a breaking change that will need every beamline to update its config and for GDA to support the new API. We have a list of breaking issues that are waiting for a 2.0 release so it might be worth adding an issue there for this change and keeping this PR around until we decide to break everything at once.

@ZohebShaikh ZohebShaikh added this to the Blueapi 2.0.0 milestone Feb 3, 2026
Comment thread src/blueapi/config.py Outdated
def _config_from_oidc_url(self) -> dict[str, Any]:
response: requests.Response = requests.get(self.well_known_url)
response: requests.Response = requests.get(
self.issuer + "/.well-known/openid-configuration"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be worth calling out that this address must exist, that may determine what the "issuer" is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spec for this is here as a MUST so we can probably rely on it.

OpenID Providers supporting Discovery MUST make a JSON document available at the path formed by concatenating the string /.well-known/openid-configuration to the Issuer

@ZohebShaikh ZohebShaikh marked this pull request as draft February 19, 2026 15:15
@ZohebShaikh ZohebShaikh requested a review from tpoliaw April 28, 2026 13:22
@ZohebShaikh ZohebShaikh marked this pull request as ready for review April 28, 2026 13:22
@ZohebShaikh

Copy link
Copy Markdown
Contributor Author

@tpoliaw I have made it backwards compatible so in v2 we can remove the backwards compatibility.

@ZohebShaikh

Copy link
Copy Markdown
Contributor Author

@tpoliaw Can you have a look at this ?

Comment thread src/blueapi/config.py
)

@model_validator(mode="after")
def check_well_know_urls(self) -> Self:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def check_well_know_urls(self) -> Self:
def check_urls(self) -> Self:

Comment thread src/blueapi/config.py
if self.well_known_url:
LOGGER.warning(
DeprecationWarning(
"well_known_url and issuer both are set. "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"well_known_url and issuer both are set. "
"well_known_url and issuer are both set. "

)


def test_oidc_config_urls():

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really two tests

@tpoliaw tpoliaw removed this from the Blueapi 2.0.0 milestone Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants