Skip to content

Allow regular user JWTs on registry endpoints#174

Merged
rgarcia merged 1 commit intomainfrom
fix/allow-user-jwts-for-registry
Mar 28, 2026
Merged

Allow regular user JWTs on registry endpoints#174
rgarcia merged 1 commit intomainfrom
fix/allow-user-jwts-for-registry

Conversation

@rgarcia
Copy link
Copy Markdown
Contributor

@rgarcia rgarcia commented Mar 28, 2026

Summary

  • allow /v2/* registry routes to fall back from builder-scoped registry token validation to regular user JWT validation
  • keep builder token validation, repo scoping, and mirror fallback behavior unchanged for registry-scoped tokens
  • add middleware tests covering regular user JWT access on registry read and write paths

Test plan

  • go test ./lib/middleware
  • Exercise hypeman push end-to-end against a dev hypeman server

Made with Cursor


Note

Medium Risk
Changes authentication behavior for /v2/* registry routes and refactors JWT validation, which is security-sensitive and could affect access control if misconfigured.

Overview
Allows /v2/* registry requests to fall back to regular user JWT validation when builder/registry-scoped token validation fails, enabling direct registry access with user tokens while keeping existing mirror fallback behavior for errRepoNotAllowed.

Refactors user JWT handling by centralizing parsing/type-rejection in validateUserToken and context population in contextWithUserClaims, and adds middleware tests to cover registry read/write access using both full-access and scoped user tokens.

Written by Cursor Bugbot for commit 2cce73f. This will update automatically on new commits. Configure here.

This lets tokens minted by hypeman-token work for direct OCI registry requests, including hypeman push, while preserving builder-token validation and mirror fallback behavior.

Made-with: Cursor
@rgarcia rgarcia merged commit a05ff49 into main Mar 28, 2026
8 of 9 checks passed
@rgarcia rgarcia deleted the fix/allow-user-jwts-for-registry branch March 28, 2026 19:31
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.

2 participants