Skip to content

✨ Add typed OPA config schema#617

Merged
bdumpp merged 3 commits into
masterfrom
issue-616-opa-config-validation
Jul 8, 2026
Merged

✨ Add typed OPA config schema#617
bdumpp merged 3 commits into
masterfrom
issue-616-opa-config-validation

Conversation

@bdumpp

@bdumpp bdumpp commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Add shared typed OPA config structs, wire the new System and ProjectConfig fields through the config merge path, and validate unknown top-level keys during config loading and reconciliation.

Closes #616

@bdumpp bdumpp requested a review from a team as a code owner July 3, 2026 11:00
@bdumpp bdumpp force-pushed the issue-616-opa-config-validation branch 2 times, most recently from 6bcb9b7 to f72a35e Compare July 7, 2026 11:30
bdumpp and others added 2 commits July 7, 2026 13:32
Add shared typed OPA config structs, wire the new System and ProjectConfig fields through the config merge path, and validate unknown top-level keys during config loading and reconciliation.

Closes #616

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Restore customOPAConfig to *runtime.RawExtension so existing System
  resources with non-standard OPA keys are not rejected on read
- Remove ValidateRaw from v1beta1.OPAConfigSpec.UnmarshalJSON; move
  validation of spec.opa.config to the admission webhook (write-only)
- Fix nil pointer panic when legacy BundleServer or DecisionAPIConfig
  is absent (controller config without legacy OPA section)
- Fix ToMap to use encoding/json instead of gopkg.in/yaml.v2 so that
  json: struct tags and runtime.RawExtension values are handled correctly
- Fix scientific notation for large integers (UseNumber + int64 conversion)
- Always emit bundles.authz.resource in the base ConfigMap

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: bdumpp <mpp@bankdata.dk>
@bdumpp bdumpp force-pushed the issue-616-opa-config-validation branch from f72a35e to 04cc464 Compare July 7, 2026 11:32
Comment thread internal/controller/styra/system_controller.go Outdated
Comment thread internal/controller/styra/system_controller.go Outdated
Comment thread pkg/opaconfig/opaconfig_test.go Outdated
Comment thread internal/controller/styra/system_controller.go
Comment thread internal/k8sconv/k8sconv.go
…OCP refactor

Signed-off-by: bdumpp <mpp@bankdata.dk>
@bdumpp bdumpp merged commit e19fbab into master Jul 8, 2026
2 checks passed
@bdumpp bdumpp deleted the issue-616-opa-config-validation branch July 8, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

All OPA config should be accessible

2 participants