Skip to content

Match authorization helpers based on registry#480

Closed
jklukas wants to merge 1 commit intomainfrom
auth-helpers-by-registry
Closed

Match authorization helpers based on registry#480
jklukas wants to merge 1 commit intomainfrom
auth-helpers-by-registry

Conversation

@jklukas
Copy link
Copy Markdown
Member

@jklukas jklukas commented Jan 16, 2025

Problem

I need to use rules_minidock with a registry where the service returned in the authentication challenge is not the registry base name, but rather a logical service name "Authentication". The header returned by the registry is like:

www-authenticate: Bearer realm="https://registry.example.com/auth/token/",service="Authentication"

I want to provide an authentication helper script to respond to this challenge, but it's never picked up by puller_app, etc. because the current logic always does matching based on the bearer service; so I believe there's an assumption here that service will be the registry base name (such as registry.example.com) but this is not necessarily true.

Solution

We maintain the current matching logic, but if no matching authentication helper is found based on service, we try to match based on the registry parameter sent to puller_app or pusher_app.

Note

Content here is exactly the same as #479 but looks like CI doesn't get triggered for forks, so had to recreate as a branch on the main repo.

@jklukas
Copy link
Copy Markdown
Member Author

jklukas commented Jan 16, 2025

CI doesn't get triggered for forks, so had to recreate as a branch on the main repo I lied. Looks like once I hit "enable auto-merge", CI did kick off and it was able to merge. Closing this one.

@jklukas jklukas closed this Jan 16, 2025
@jklukas jklukas deleted the auth-helpers-by-registry branch January 16, 2025 19:37
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.

1 participant