Skip to content

Add support for chained RequestAuthConfigs for push/pull#50341

Draft
thaJeztah wants to merge 3 commits intomoby:masterfrom
thaJeztah:client_auth_chain
Draft

Add support for chained RequestAuthConfigs for push/pull#50341
thaJeztah wants to merge 3 commits intomoby:masterfrom
thaJeztah:client_auth_chain

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jul 7, 2025

client: implement chainPrivilegeFuncs utility

This utility allows chaining privilegeFuncs to try multiple options for authentication.

Add support for chained RequestAuthConfigs for push/pull

PrivilegeFunc was added in 18472 as an alternative to passing static
authentication. The default was still to try the static authentication
before calling the PrivilegeFunc (if present).

For now, we need to keep this behavior, as PrivilegeFunc may be an
interactive prompt, however, we should change this to only use static
auth if not empty. Ultimately, we should deprecate its use in favor of
callers providing a PrivilegeFunc (which can be chained), or a list of
PrivilegeFuncs.

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah force-pushed the client_auth_chain branch from c6ea9b8 to f09e432 Compare July 7, 2025 14:21
@thaJeztah thaJeztah changed the title Add support for chained RequestAuthConfigs for push/pul Add support for chained RequestAuthConfigs for push/pull Jul 7, 2025
@thaJeztah
Copy link
Member Author

Derp; forgot to unstash a patch.

This utility allows chaining privilegeFuncs to try multiple options
for authentication.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
PrivilegeFunc was added in [18472] as an alternative to passing static
authentication. The default was still to try the static authentication
before calling the PrivilegeFunc (if present).

For now, we need to keep this behavior, as PrivilegeFunc may be an
interactive prompt, however, we should change this to only use static
auth if not empty. Ultimately, we should deprecate its use in favor of
callers providing a PrivilegeFunc (which can be chained), or a list of
PrivilegeFuncs.

[18472]: moby@e78f02c

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant