Skip to content

Commit e6a8e16

Browse files
ChrisJBurnsclaude
andcommitted
Refresh validateAuthzConfig doc comment
The prior comment said backend validation lived in the controller "because the API types package must not import the authorizer backends" — but the types package now imports pkg/authz/authorizers to call IsRegistered in Validate(). Restate the real reason: type-level Validate handles structural + registration checks; backend ValidateConfig requires the full reconstructed JSON envelope that only the controller builds. Drive-by: gitignore .pr-review/ so PR-review skill scratch dirs don't pollute git status in worktrees. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 193ff75 commit e6a8e16

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ cmd/vmcp/__debug_bin*
5050

5151
# Superpowers planning artifacts
5252
docs/superpowers/
53+
.pr-review/

cmd/thv-operator/controllers/mcpauthzconfig_controller.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ func setValidTrueCondition(c *mcpv1beta1.MCPAuthzConfig) {
173173
// validation on the type (Validate()), then reconstructs the full authorizer config
174174
// and delegates backend-specific validation to the factory's ValidateConfig method.
175175
//
176-
// Backend validation lives here rather than as a Validate() method on the type because
177-
// it requires the authorizer factory registry — an external dependency that the API
178-
// types package must not import.
176+
// The type's Validate() handles structural checks and verifies that spec.type is
177+
// a registered backend. Backend-specific schema validation lives here because
178+
// the factory's ValidateConfig consumes the full reconstructed JSON envelope
179+
// (version + type + nested config), which it is not the type's responsibility
180+
// to build.
179181
func (*MCPAuthzConfigReconciler) validateAuthzConfig(authzConfig *mcpv1beta1.MCPAuthzConfig) error {
180182
if err := authzConfig.Validate(); err != nil {
181183
return err

0 commit comments

Comments
 (0)