Skip to content

Commit fab42ee

Browse files
committed
refactor: add default values for OPA
1 parent c4d18bd commit fab42ee

4 files changed

Lines changed: 9 additions & 16 deletions

File tree

‎helm/blueapi/config_schema.json‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,23 +301,21 @@
301301
"type": "string"
302302
},
303303
"tiled_service_account_check": {
304+
"default": "blueapi/tiled_service_account_for_beamline",
304305
"title": "Tiled Service Account Check",
305306
"type": "string"
306307
},
307308
"submit_task_check": {
309+
"default": "blueapi/write_to_beamline_visit",
308310
"title": "Submit Task Check",
309311
"type": "string"
310312
},
311313
"admin_check": {
314+
"default": "admin/admin",
312315
"title": "Admin Check",
313316
"type": "string"
314317
}
315318
},
316-
"required": [
317-
"tiled_service_account_check",
318-
"submit_task_check",
319-
"admin_check"
320-
],
321319
"title": "OpaConfig",
322320
"type": "object",
323321
"$id": "OpaConfig"

‎helm/blueapi/values.schema.json‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -714,14 +714,10 @@
714714
"$id": "OpaConfig",
715715
"title": "OpaConfig",
716716
"type": "object",
717-
"required": [
718-
"tiled_service_account_check",
719-
"submit_task_check",
720-
"admin_check"
721-
],
722717
"properties": {
723718
"admin_check": {
724719
"title": "Admin Check",
720+
"default": "admin/admin",
725721
"type": "string"
726722
},
727723
"audience": {
@@ -739,10 +735,12 @@
739735
},
740736
"submit_task_check": {
741737
"title": "Submit Task Check",
738+
"default": "blueapi/write_to_beamline_visit",
742739
"type": "string"
743740
},
744741
"tiled_service_account_check": {
745742
"title": "Tiled Service Account Check",
743+
"default": "blueapi/tiled_service_account_for_beamline",
746744
"type": "string"
747745
}
748746
},

‎src/blueapi/config.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ class Tag(StrEnum):
312312
class OpaConfig(BlueapiBaseModel):
313313
root: HttpUrl = HttpUrl("http://localhost:8181")
314314
audience: str = "account"
315-
tiled_service_account_check: str
316-
submit_task_check: str
317-
admin_check: str
315+
tiled_service_account_check: str = "blueapi/tiled_service_account_for_beamline"
316+
submit_task_check: str = "blueapi/write_to_beamline_visit"
317+
admin_check: str = "admin/admin"
318318

319319

320320
class ApplicationConfig(BlueapiBaseModel):

‎tests/system_tests/config.yaml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,3 @@ oidc:
2727
client_audience: "ixx-blueapi"
2828
opa:
2929
root: "http://localhost:8181/v1/data/diamond/policy/"
30-
tiled_service_account_check: "blueapi/tiled_service_account_for_beamline"
31-
submit_task_check: "blueapi/write_to_beamline_visit"
32-
admin_check: "admin/admin"

0 commit comments

Comments
 (0)