feat: Add OpaClient to wrap auth checks#1541
Conversation
e8ddc77 to
db3325b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## depends-user #1541 +/- ##
================================================
+ Coverage 95.63% 95.77% +0.14%
================================================
Files 43 44 +1
Lines 3228 3264 +36
================================================
+ Hits 3087 3126 +39
+ Misses 141 138 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
|
|
||
| class OpaConfig(BlueapiBaseModel): | ||
| root: HttpUrl = HttpUrl("http://localhost:8181") |
There was a problem hiding this comment.
why hard coded this URL in ? will this always the case on beamline?
There was a problem hiding this comment.
The hardcoded value is a default (the opa server used in system tests) similar to the ones for numtracker and OIDC. On beamlines, this will be overwritten by the config (in the beamline's values.yaml)
There was a problem hiding this comment.
Thanks for the explaination as from the codes I did see how this URL being replaced by other on beamline, I must have missed some codes that does the overwrite.
| } | ||
| }, | ||
| "additionalProperties": false | ||
| }, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
When deploying blueapi via helm, the config is included in the values.yaml file. When the schema of the config changes, the embedded config in the values file changes in the same way.
Proof of concept opa client with dependency injection and example check