Files
moby/client/auth.go
Sebastiaan van Stijn 79b4e18883 client: add staticAuth utility
Add a small utility to create a "RequestAuthConfig" from
a static value.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-27 13:12:50 +02:00

15 lines
302 B
Go

package client
import (
"context"
"github.com/docker/docker/api/types/registry"
)
// staticAuth creates a privilegeFn from the given registryAuth.
func staticAuth(registryAuth string) registry.RequestAuthConfig {
return func(ctx context.Context) (string, error) {
return registryAuth, nil
}
}