Skip to content

feat: Add OpaClient to wrap auth checks#1541

Open
tpoliaw wants to merge 5 commits into
depends-userfrom
opa-client
Open

feat: Add OpaClient to wrap auth checks#1541
tpoliaw wants to merge 5 commits into
depends-userfrom
opa-client

Conversation

@tpoliaw
Copy link
Copy Markdown
Contributor

@tpoliaw tpoliaw commented May 15, 2026

Proof of concept opa client with dependency injection and example check

@tpoliaw tpoliaw changed the title feat: Add OpaClient to wrap auth checks" feat: Add OpaClient to wrap auth checks May 15, 2026
Comment thread src/blueapi/service/main.py Fixed
@tpoliaw tpoliaw force-pushed the opa-client branch 2 times, most recently from e8ddc77 to db3325b Compare May 15, 2026 15:31
@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

❌ Patch coverage is 89.36170% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.63%. Comparing base (e6ca161) to head (fff101b).

Files with missing lines Patch % Lines
src/blueapi/service/authorization.py 87.17% 5 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           depends-user    #1541   +/-   ##
=============================================
  Coverage         95.63%   95.63%           
=============================================
  Files                43       44    +1     
  Lines              3228     3274   +46     
=============================================
+ Hits               3087     3131   +44     
- Misses              141      143    +2     

☔ View full report in Codecov by Sentry.
📢 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.

@tpoliaw tpoliaw changed the base branch from main to depends-user May 29, 2026 10:50
@tpoliaw tpoliaw marked this pull request as ready for review June 2, 2026 11:13
@tpoliaw tpoliaw requested a review from a team as a code owner June 2, 2026 11:13
Copy link
Copy Markdown

@fajinyuan fajinyuan left a comment

Choose a reason for hiding this comment

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

please see my questions.

Comment thread src/blueapi/config.py


class OpaConfig(BlueapiBaseModel):
root: HttpUrl = HttpUrl("http://localhost:8181")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why hard coded this URL in ? will this always the case on beamline?

}
},
"additionalProperties": false
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I am new to cloud programming, but would like to understand why there are the same json section here as in config_schema.json above?

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.

2 participants