Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct {
AuthToken string `json:"auth_token,omitempty"`
NPM *NPMAuthConfig `json:"npm,omitempty"`
OCI *OCIAuthConfig `json:"oci,omitempty"`
Git *GitAuthConfig `json:"git,omitempty"`
}
Credentials holds all resolved credential values.
type GitAuthConfig ¶
type GitAuthConfig struct {
Routes []GitRoute `json:"routes,omitempty"`
}
GitAuthConfig holds Git routing table configuration.
type GitRoute ¶
type GitRoute struct {
Match GitRouteMatch `json:"match"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
GitRoute defines a single Git routing rule.
type GitRouteMatch ¶
type GitRouteMatch struct {
RepoPrefix string `json:"repo_prefix,omitempty"`
Any bool `json:"any,omitempty"`
}
GitRouteMatch defines the matching criteria for a Git route.
type NPMAuthConfig ¶
type NPMAuthConfig struct {
Routes []NPMRoute `json:"routes,omitempty"`
}
NPMAuthConfig holds NPM routing table configuration.
type NPMRoute ¶
type NPMRoute struct {
Match NPMRouteMatch `json:"match"`
RegistryURL string `json:"registry_url"`
Token string `json:"token,omitempty"`
}
NPMRoute defines a single NPM routing rule.
type NPMRouteMatch ¶
NPMRouteMatch defines the matching criteria for an NPM route.
type OCIAuthConfig ¶
type OCIAuthConfig struct {
Registries []OCIRegistry `json:"registries,omitempty"`
}
OCIAuthConfig holds OCI registry configuration.
type OCIRegistry ¶
type OCIRegistry struct {
Prefix string `json:"prefix"`
Upstream string `json:"upstream"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
TagTTL string `json:"tag_ttl,omitempty"`
}
OCIRegistry defines a single OCI registry entry.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver executes a template file and parses the result into Credentials.
func NewResolver ¶
func NewResolver(opts ...ResolverOption) *Resolver
NewResolver creates a new credential resolver with the given options.
func (*Resolver) ResolveFile ¶
ResolveFile reads and resolves a credentials template file.
func (*Resolver) ResolveReader ¶
ResolveReader resolves a credentials template from a reader.
type ResolverOption ¶
type ResolverOption func(*Resolver)
ResolverOption configures a Resolver.
func WithLogger ¶
func WithLogger(logger *slog.Logger) ResolverOption
WithLogger sets the logger for the resolver.
func WithProvider ¶
func WithProvider(name string, p SecretProvider) ResolverOption
WithProvider registers a named secret provider as a template function.