Skip to content

Fix registry auth to send base64url-encoded X-Registry-Auth header - #105

Merged
clue merged 1 commit into
clue:1.xfrom
clue-labs:registry-auth
Oct 18, 2026
Merged

clue merged 1 commit into
clue:1.xfrom
clue-labs:registry-auth

Conversation

@clue

@clue clue commented Oct 18, 2026

Copy link
Copy Markdown
Owner

This changeset fixes the registry authentication for imageCreate() and imagePush() to send the X-Registry-Auth header base64url-encoded as Docker expects. It previously used standard base64, so whenever the encoded credentials happened to contain a + or /, Docker could not decode the header and ignored the credentials. This only affected some credentials, which likely explains why it went unnoticed since the very first release in 2014.

Refs https://github.com/moby/moby/blob/docker-v29.9.1/api/pkg/authconfig/authconfig.go

@clue clue added the bug Something isn't working label Oct 18, 2026
@clue clue added this to the v1.7.0 milestone Oct 18, 2026
@clue
clue requested a balanced review from Copilot October 18, 2026 01:11

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.

🟢 Approval recommended

The focused encoding fix matches Docker’s requirements, and the regression test covers both affected characters.

No open issues 🎉

What changed in this PR

Fixes registry authentication for imageCreate() and imagePush() by sending Docker-compatible base64url headers.

Changes:

  • Updates the shared encoder and its documentation.
  • Adds a regression test covering both character substitutions.
File Description
tests/​ClientTest.php Verifies the encoded registry-auth header during image push.
src/​Client.php Converts base64 + and / to base64url - and _.

Review effort: Balanced

@clue
clue merged commit 043f4df into clue:1.x Oct 18, 2026
15 checks passed
@clue
clue deleted the registry-auth branch October 18, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants