From fab42eef82d35e4ababc08344dfedcf10c107422 Mon Sep 17 00:00:00 2001 From: Zoheb Shaikh <26975142+ZohebShaikh@users.noreply.github.com> Date: Sat, 8 Aug 2026 21:20:27 +0100 Subject: [PATCH] refactor: add default values for OPA --- helm/blueapi/config_schema.json | 8 +++----- helm/blueapi/values.schema.json | 8 +++----- src/blueapi/config.py | 6 +++--- tests/system_tests/config.yaml | 3 --- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/helm/blueapi/config_schema.json b/helm/blueapi/config_schema.json index 3b9d03138f..0755a2c6ea 100644 --- a/helm/blueapi/config_schema.json +++ b/helm/blueapi/config_schema.json @@ -301,23 +301,21 @@ "type": "string" }, "tiled_service_account_check": { + "default": "blueapi/tiled_service_account_for_beamline", "title": "Tiled Service Account Check", "type": "string" }, "submit_task_check": { + "default": "blueapi/write_to_beamline_visit", "title": "Submit Task Check", "type": "string" }, "admin_check": { + "default": "admin/admin", "title": "Admin Check", "type": "string" } }, - "required": [ - "tiled_service_account_check", - "submit_task_check", - "admin_check" - ], "title": "OpaConfig", "type": "object", "$id": "OpaConfig" diff --git a/helm/blueapi/values.schema.json b/helm/blueapi/values.schema.json index 51b89beadb..3020e5502c 100644 --- a/helm/blueapi/values.schema.json +++ b/helm/blueapi/values.schema.json @@ -714,14 +714,10 @@ "$id": "OpaConfig", "title": "OpaConfig", "type": "object", - "required": [ - "tiled_service_account_check", - "submit_task_check", - "admin_check" - ], "properties": { "admin_check": { "title": "Admin Check", + "default": "admin/admin", "type": "string" }, "audience": { @@ -739,10 +735,12 @@ }, "submit_task_check": { "title": "Submit Task Check", + "default": "blueapi/write_to_beamline_visit", "type": "string" }, "tiled_service_account_check": { "title": "Tiled Service Account Check", + "default": "blueapi/tiled_service_account_for_beamline", "type": "string" } }, diff --git a/src/blueapi/config.py b/src/blueapi/config.py index a181f4c344..6a05699b96 100644 --- a/src/blueapi/config.py +++ b/src/blueapi/config.py @@ -312,9 +312,9 @@ class Tag(StrEnum): class OpaConfig(BlueapiBaseModel): root: HttpUrl = HttpUrl("http://localhost:8181") audience: str = "account" - tiled_service_account_check: str - submit_task_check: str - admin_check: str + tiled_service_account_check: str = "blueapi/tiled_service_account_for_beamline" + submit_task_check: str = "blueapi/write_to_beamline_visit" + admin_check: str = "admin/admin" class ApplicationConfig(BlueapiBaseModel): diff --git a/tests/system_tests/config.yaml b/tests/system_tests/config.yaml index a55417d4cf..89f94e5335 100644 --- a/tests/system_tests/config.yaml +++ b/tests/system_tests/config.yaml @@ -27,6 +27,3 @@ oidc: client_audience: "ixx-blueapi" opa: root: "http://localhost:8181/v1/data/diamond/policy/" - tiled_service_account_check: "blueapi/tiled_service_account_for_beamline" - submit_task_check: "blueapi/write_to_beamline_visit" - admin_check: "admin/admin"