Skip to content

Commit fd66a1f

Browse files
committed
Drop CI guard against direct RegisterClientDynamically calls
The Taskfile check-dcr-isolation grep guard and its workflow counterpart added extra surface area to enforce an architectural invariant. Removing both per reviewer preference; the resolver boundary remains enforced by code review alone.
1 parent 582bf97 commit fd66a1f

2 files changed

Lines changed: 0 additions & 65 deletions

File tree

.github/workflows/lint.yml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,3 @@ jobs:
4444
with:
4545
# Enable golangci-lint's built-in caching (removes skip-cache: true)
4646
args: --timeout=5m
47-
48-
# Enforces issue #5145's invariant that
49-
# oauthproto.RegisterClientDynamically is only called from
50-
# pkg/auth/dcr (the shared resolver) or pkg/oauthproto (the
51-
# wire-shape primitive itself). Direct calls from elsewhere bypass
52-
# the resolver's S256 PKCE gating, singleflight deduplication,
53-
# expiry-driven refetch, bearer-token transport with redirect
54-
# refusal, and panic recovery. See Taskfile.yml::check-dcr-isolation
55-
# for the rationale and matching shell command.
56-
- name: Check DCR isolation invariant
57-
run: |
58-
matches=$(grep -rn 'oauthproto\.RegisterClientDynamically\|\.RegisterClientDynamically(' \
59-
--include='*.go' \
60-
--exclude-dir='vendor' \
61-
--exclude-dir='mocks' \
62-
. 2>/dev/null \
63-
| grep -v '^./pkg/auth/dcr/' \
64-
| grep -v '^./pkg/oauthproto/' \
65-
|| true)
66-
if [ -n "$matches" ]; then
67-
echo "ERROR: oauthproto.RegisterClientDynamically must only be called from pkg/auth/dcr or pkg/oauthproto."
68-
echo " Route the call through pkg/auth/dcr.ResolveCredentials so the consumer inherits"
69-
echo " S256 PKCE gating, singleflight, expiry refetch, redirect refusal, and panic recovery."
70-
echo ""
71-
echo "Offending references:"
72-
echo "$matches"
73-
exit 1
74-
fi
75-
echo "check-dcr-isolation: ok"

Taskfile.yml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ tasks:
6060

6161
lint:
6262
desc: Run linting tools
63-
deps: [check-dcr-isolation]
6463
cmds:
6564
- golangci-lint run --allow-parallel-runners ./...
6665
- go vet ./...
@@ -70,41 +69,6 @@ tasks:
7069
cmds:
7170
- golangci-lint run --allow-parallel-runners --fix ./...
7271

73-
check-dcr-isolation:
74-
desc: Verify oauthproto.RegisterClientDynamically is not called outside pkg/auth/dcr or pkg/oauthproto
75-
summary: |
76-
Enforces the invariant that the RFC 7591 Dynamic Client Registration
77-
wire-shape primitive (oauthproto.RegisterClientDynamically) is only
78-
called by the shared resolver in pkg/auth/dcr. Direct calls from
79-
elsewhere bypass the resolver's S256 PKCE gating, singleflight
80-
deduplication, expiry-driven refetch, bearer-token transport (with
81-
redirect refusal), and panic recovery — every property added in PR
82-
#5042 — silently weakening every CLI/UI consumer's compliance.
83-
84-
See issue #5145 (parent) and #5219 (this guard's introducing
85-
sub-issue) for the design discussion.
86-
silent: true
87-
cmds:
88-
- |
89-
matches=$(grep -rn 'oauthproto\.RegisterClientDynamically\|\.RegisterClientDynamically(' \
90-
--include='*.go' \
91-
--exclude-dir='vendor' \
92-
--exclude-dir='mocks' \
93-
. 2>/dev/null \
94-
| grep -v '^./pkg/auth/dcr/' \
95-
| grep -v '^./pkg/oauthproto/' \
96-
|| true)
97-
if [ -n "$matches" ]; then
98-
echo "ERROR: oauthproto.RegisterClientDynamically must only be called from pkg/auth/dcr or pkg/oauthproto." >&2
99-
echo " Route the call through pkg/auth/dcr.ResolveCredentials so the consumer inherits" >&2
100-
echo " S256 PKCE gating, singleflight, expiry refetch, redirect refusal, and panic recovery." >&2
101-
echo "" >&2
102-
echo "Offending references:" >&2
103-
echo "$matches" >&2
104-
exit 1
105-
fi
106-
echo "check-dcr-isolation: ok"
107-
10872
test-unixlike:
10973
desc: Run unit tests (excluding e2e tests) on Linux and macOS with race detection
11074
platforms: [linux, darwin]

0 commit comments

Comments
 (0)