Guard token exchange may_act CEL - #6532
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6532 +/- ##
==========================================
+ Coverage 78.69% 78.73% +0.04%
==========================================
Files 777 777
Lines 76797 76797
==========================================
+ Hits 60434 60466 +32
+ Misses 16358 16326 -32
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Emre K <110906681+kocaemre@users.noreply.github.com>
a20f7cb to
8ebd5e5
Compare
|
Refreshed this branch onto current No code changes beyond replaying the existing PR commit on top of current upstream. Why I refreshed: the prior CI run had a single failing Local verification in this cron environment: git diff --check origin/main..HEAD
# passed
git log --format='%h %s%n%b' origin/main..HEAD
# 8ebd5e5b Guard token exchange may_act CEL
# Signed-off-by: Emre K <110906681+kocaemre@users.noreply.github.com>I attempted the targeted operator integration task, but local execution is blocked by the cron shell's old Go toolchain: task operator-test-integration -- mcp-external-auth/inbound_grants_cel_test.go
# go install sigs.k8s.io/controller-runtime/tools/setup-envtest@release-0.22
# go.mod:3: invalid go version '1.24.0': must match format 1.23
# task: Failed to run task "operator-test-integration": exit status 1GitHub CI is running again on the refreshed head; current status at the time of this comment is queued/in-progress for the ToolHive checks. |
Summary
allowMayActis omitted, because the CEL rule dereferences the optional field withouthas().has(self.allowMayAct)guard already used by the legacy issuer-policy rule, regenerate the CRDs/Helm-wrapped CRDs, and cover the omitted-allowMayActwildcard case in the envtest CEL suite.Fixes #6531
Type of change
Test plan
task test)task test-e2e)task lint-fix)Commands run:
I also ran
task lint; it failed before reaching any changed file on two existing gci formatting findings inpkg/authserver/server/provider.goandpkg/authserver/server_impl.go, so I did not include lint-fix churn in this focused PR.API Compatibility
v1beta1API, OR theapi-break-allowedlabel is applied and the migration guidance is described above.This relaxes an admission rule so omitted
allowMayActis handled as false, matching the legacy issuer-policy rule. No fields are added, removed, or renamed.Changes
cmd/thv-operator/api/v1beta1/mcpexternalauthconfig_types.goallowMayActaccess in the canonical token-exchange CEL rule.cmd/thv-operator/test-integration/mcp-external-auth/inbound_grants_cel_test.goallowMayAct.deploy/charts/operator-crds/**Does this introduce a user-facing change?
Yes. A canonical
inboundGrants.tokenExchange.issuerPolicies[]entry may now omitallowMayActwhile usingallowedDelegateClients: ["*"]; admission treats the omitted optional bool as false instead of failing withno such key: allowMayAct.