Refactor reusable OAuth core primitives - #8
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
internal/oauthcoreas the first reusable OAuth boundaryoauthcoreoauthproxyas the HTTP/proxy adapter through type aliases and small adapter callshugo-mcp-goauth dependencyCompatibility guardrail
mcp-runtime-gois still used byhugo-mcp-gofor auth. This PR must not reorient or break that runtime.This PR does not change:
ANONYMOUS_ENABLED=falsedefault behavior/mcpproxy routingAuthorization: Bearer <HUGO_TOKEN>injectionHUGO_MCP_URL,HUGO_HOST, orHUGO_TOKENsemanticsoauthproxyScope
This is the first implementation slice for #6. It intentionally extracts only low-risk primitives and pure policy logic.
Extracted:
Intentionally not included
hugo-public-mcp/authorizechangeoauthproxy.ServiceReviewer Guide
Focus on whether
oauthcoreremains generic and free of proxy-only concepts. In particular, it should not know about backend URLs, Hugo host/token injection, reverse proxy paths, or response mutation.Also verify the new
TestHandleProxy_LegacyDefaultOAuthProxyBehaviorUnchangedcontract:Validation
go test ./...go test -race ./...go vet ./...gitleaks detect --no-banner --redact --source .golangci-lint run ./...was also attempted and currently reports pre-existing repository-wide errcheck/staticcheck issues outside the scope of this extraction. This PR does not add a new golangci configuration or broad lint cleanup.Production impact
None. This is an internal refactor with tests. No tag, no release, no deploy.
Refs #6