credentials

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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

type NPMRouteMatch struct {
	Scope string `json:"scope,omitempty"`
	Any   bool   `json:"any,omitempty"`
}

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

func (r *Resolver) ResolveFile(ctx context.Context, path string) (*Credentials, error)

ResolveFile reads and resolves a credentials template file.

func (*Resolver) ResolveReader

func (r *Resolver) ResolveReader(ctx context.Context, reader io.Reader) (*Credentials, error)

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.

type SecretProvider

type SecretProvider func(ctx context.Context, ref string) (string, error)

SecretProvider resolves a secret reference to its value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL