You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[scanner] hub-auth: pin Hub login contract with fail-closed and no-secret-in-URL/log tests #14636
Regression-test lane after the exchange and PKCE changes: add table-driven tests in src/pkg/hub that pin the whole browser login contract using an httptest fake of the GitHub token and user endpoints: authorize redirect shape (empty scope, redirect_uri, state, code_challenge/S256), token request (method POST, no URL query, form body fields, no secrets in the URL), and fail-closed matrix (no state cookie, state mismatch, missing/mismatched/expired verifier, replayed callback after cookie cleared) asserting zero token-endpoint calls and no session cookie set. Also assert log output (capture s.logger) never contains the client secret, code, or access token. Keep existing identity validation (isValidName, oauth.go ~:990) and encrypted-token persistence (oauth.go:847) covered. The token endpoint is the package constant defaultGHTokenURL (oauth.go:47); if the tests need an override seam, add the smallest test-only injection.
Decision taken by hive: tests only plus a minimal seam; no production behavior change.
Acceptance criteria
Tests cover every case above and fail if secrets reappear in the URL or logs.
Good first issue — superseded: hosted-available-oke-11-placeholder-r05x started working on this issue itself (claimed-by-hive, 2026-10-29T01:17:15Z), so the good first issue label has been removed. Thanks for looking! Other issues open to new contributors are listed on the relay page: https://hosted-kubestellar-hive-ojv6.hive.hivecommons.dev/contribute
🔒 Claimed by @Karibhou (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.
Follow-up from review of #15128: state/exchange tests and most PKCE assertions are now covered, but do not close this child as fully complete. The new verifier-rejected fixture submits the original verifier and unconditionally returns a GitHub error; it is endpoint-error handling, not an actual swapped valid-verifier transaction. The parent #14598 still literally requires mismatch rejection before exchange, while the implementation validates syntax locally and delegates challenge matching to GitHub. Preserve that discrepancy explicitly; do not weaken/re-pin tests to claim zero exchanges without production support. Keep the scope distinction between this tests-only child and any parent-level transaction-binding change.
Verified against v6 after #14893 and #15128. Covered in oauth_browser_contract_test.go / oauth_pkce_test.go: authorize shape (empty scope, redirect_uri, state, S256 challenge), form POST with no URL query or secrets, no-state-cookie / state-mismatch / missing-state / missing, empty, malformed and truncated verifier failing before exchange with zero token calls and no session cookie, replay after cookie clear, identity validation, encrypted-token persistence, and log output free of secret/code/token.
One gap remains: a valid but swapped verifier is not rejected locally. Production only checks verifier syntax and leaves challenge matching to GitHub, so the 'verifier rejected' fixture covers endpoint-error handling, not mismatch rejection before exchange. Asserting zero exchanges there would need a production change, which this tests-only child excludes, so no further test is added. Leaving open and not re-pinning to claim otherwise; the transaction-binding decision belongs to #14598.
🔒 Claimed by agent scanner (agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.
Closing as completed on v6. The remainder @hanthor flagged (a real swapped valid-verifier transaction, not endpoint-error handling) is now pinned because #15179 (merged 2026-10-29, v6) binds the PKCE verifier to the login transaction before exchange: TestGitHubBrowserVerifierFailsBeforeExchange (src/pkg/hub/oauth_browser_contract_test.go) covers swapped valid / one-char-changed / max-length verifiers plus missing-or-expired, malformed and stripped-challenge cases, each asserting 400, zero token-endpoint calls, no session cookie, and no code/verifier in logs; TestPKCE_ReplayedCallbackIsRejected (oauth_pkce_test.go) covers replay after cookie clearing; #14893/#15128 cover state, exchange shape and no-secret-in-URL. The parent #14598 discrepancy (local syntax check vs GitHub-side matching) no longer exists, so no tests-only PR is needed. /unclaim
Activity
hivecommons-hive commentedon Oct 27, 2026
Good first issue— superseded: hosted-available-oke-11-placeholder-r05x started working on this issue itself (claimed-by-hive, 2026-10-29T01:17:15Z), so thegood first issuelabel has been removed. Thanks for looking! Other issues open to new contributors are listed on the relay page: https://hosted-kubestellar-hive-ojv6.hive.hivecommons.dev/contributehivecommons-hive commentedon Oct 27, 2026
🔒 Claimed by @Karibhou (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply
/unclaimto release, or/claimto take it over if you outrank the holder.hivecommons-hive commentedon Oct 27, 2026
🔓 Claim by @Karibhou released (lease revoked).
26 remaining items
hanthor commentedon Oct 28, 2026
Follow-up from review of #15128: state/exchange tests and most PKCE assertions are now covered, but do not close this child as fully complete. The new verifier-rejected fixture submits the original verifier and unconditionally returns a GitHub error; it is endpoint-error handling, not an actual swapped valid-verifier transaction. The parent #14598 still literally requires mismatch rejection before exchange, while the implementation validates syntax locally and delegates challenge matching to GitHub. Preserve that discrepancy explicitly; do not weaken/re-pin tests to claim zero exchanges without production support. Keep the scope distinction between this tests-only child and any parent-level transaction-binding change.
hivecommons-hive commentedon Oct 28, 2026
Verified against v6 after #14893 and #15128. Covered in
oauth_browser_contract_test.go/oauth_pkce_test.go: authorize shape (empty scope, redirect_uri, state, S256 challenge), form POST with no URL query or secrets, no-state-cookie / state-mismatch / missing-state / missing, empty, malformed and truncated verifier failing before exchange with zero token calls and no session cookie, replay after cookie clear, identity validation, encrypted-token persistence, and log output free of secret/code/token.One gap remains: a valid but swapped verifier is not rejected locally. Production only checks verifier syntax and leaves challenge matching to GitHub, so the 'verifier rejected' fixture covers endpoint-error handling, not mismatch rejection before exchange. Asserting zero exchanges there would need a production change, which this tests-only child excludes, so no further test is added. Leaving open and not re-pinning to claim otherwise; the transaction-binding decision belongs to #14598.
🐝 Hive Agent:
scanner| Instance:hosted-available-oke-11-placeholder-r05x| SHA:c5939b62a— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88
hivecommons-hive commentedon Oct 29, 2026
🔒 Claimed by agent
scanner(agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply/unclaimto release, or/claimto take it over if you outrank the holder.hivecommons-hive commentedon Oct 29, 2026
Closing as completed on v6. The remainder @hanthor flagged (a real swapped valid-verifier transaction, not endpoint-error handling) is now pinned because #15179 (merged 2026-10-29, v6) binds the PKCE verifier to the login transaction before exchange:
TestGitHubBrowserVerifierFailsBeforeExchange(src/pkg/hub/oauth_browser_contract_test.go) covers swapped valid / one-char-changed / max-length verifiers plus missing-or-expired, malformed and stripped-challenge cases, each asserting 400, zero token-endpoint calls, no session cookie, and no code/verifier in logs;TestPKCE_ReplayedCallbackIsRejected(oauth_pkce_test.go) covers replay after cookie clearing; #14893/#15128 cover state, exchange shape and no-secret-in-URL. The parent #14598 discrepancy (local syntax check vs GitHub-side matching) no longer exists, so no tests-only PR is needed. /unclaim🐝 Hive Agent:
scanner| Instance:hosted-available-oke-11-placeholder-r05x| SHA:unknown— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88