Skip to content

Remove dead TryAuthOIDCRequestWithPrefix function#107

Merged
kbukum1 merged 1 commit into
mainfrom
remove-dead-oidc-code
Apr 21, 2026
Merged

Remove dead TryAuthOIDCRequestWithPrefix function#107
kbukum1 merged 1 commit into
mainfrom
remove-dead-oidc-code

Conversation

@kbukum1

@kbukum1 kbukum1 commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

What are you trying to accomplish?

Remove dead code left behind after the OIDCRegistry migration (PRs #78#92). The TryAuthOIDCRequestWithPrefix function in internal/oidc/oidc_credential.go was the old per-handler OIDC authentication pattern. All handlers now use OIDCRegistry.TryAuth() instead, leaving this function with zero callers anywhere in the codebase.

Cleaning this up reduces confusion for future contributors and removes unused dependencies from the file.

Anything you want to highlight for special attention from reviewers?

Removing the function also allows removing 4 imports that were only used by it: net/http, goproxy, helpers, and logging. The sync import is retained since it is still used by the OIDCCredential.mutex field.

The CreateOIDCCredential calls in cargo/hex/pub handlers (used as guard clauses to skip URL-less OIDC credentials) were reviewed and confirmed to be intentional, not dead code.

How will you know you have accomplished your goal?

  • Confirmed zero callers via grep across the entire codebase
  • go build ./... succeeds
  • go test ./... passes (all packages)

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

This function was the old OIDC authentication pattern used by individual
handlers before the OIDCRegistry migration (PRs #78-#92). All handlers
now use OIDCRegistry.TryAuth() instead, leaving TryAuthOIDCRequestWithPrefix
with zero callers.

Also removes 4 imports that were only used by the dead function:
net/http, goproxy, helpers, and logging.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 21, 2026 18:09
@kbukum1 kbukum1 requested a review from a team as a code owner April 21, 2026 18:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes unused legacy OIDC request-authentication code (TryAuthOIDCRequestWithPrefix) that was superseded by the OIDCRegistry migration, reducing confusion and cleaning up now-unneeded dependencies in the OIDC credential implementation.

Changes:

  • Deleted the dead TryAuthOIDCRequestWithPrefix helper from internal/oidc/oidc_credential.go.
  • Removed imports that were only used by that function (net/http, goproxy, helpers, logging).
Show a summary per file
File Description
internal/oidc/oidc_credential.go Removes legacy per-handler OIDC request auth helper and related unused imports, aligning with current OIDCRegistry.TryAuth usage.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@kbukum1 kbukum1 merged commit b9fdf49 into main Apr 21, 2026
99 of 102 checks passed
@kbukum1 kbukum1 deleted the remove-dead-oidc-code branch April 21, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants