Documentation
¶
Index ¶
- Variables
- func FetchURL(ctx context.Context, rawURL string) ([]byte, error)
- func FetchURLWithOptions(ctx context.Context, rawURL string, options URLFetchOptions) ([]byte, error)
- func ResolveReferences(ctx context.Context, rs *resources.ResourceSet) error
- func ValidateYAMLFile(path string) bool
- type ExpandedDocument
- type FieldResolver
- type Loader
- func (l *Loader) ExpandSources(ctx context.Context, sources []Source, recursive bool) ([]ExpandedDocument, error)
- func (l *Loader) Load() (*resources.ResourceSet, error)
- func (l *Loader) LoadFile(path string) (*resources.ResourceSet, error)
- func (l *Loader) LoadFromSources(sources []Source, recursive bool) (*resources.ResourceSet, error)
- func (l *Loader) LoadFromSourcesWithContext(ctx context.Context, sources []Source, recursive bool) (*resources.ResourceSet, error)
- func (l *Loader) WithStdin(reader io.Reader) *Loader
- func (l *Loader) WithURLFetchOptions(options URLFetchOptions) *Loader
- type LocalFieldResolver
- type PrincipalCSVSummary
- type Source
- type SourceType
- type URLFetchAuthPolicy
- type URLFetchOptions
- type URLFetchTokenSource
Constants ¶
This section is empty.
Variables ¶
var ErrNoSources = errors.New("no configuration sources specified; use -f to specify files, directories, or URLs")
ErrNoSources is returned when no configuration sources are provided.
Functions ¶
func FetchURL ¶ added in v1.3.0
FetchURL retrieves a declarative configuration source from an HTTP(S) URL.
func FetchURLWithOptions ¶ added in v1.3.0
func FetchURLWithOptions(ctx context.Context, rawURL string, options URLFetchOptions) ([]byte, error)
FetchURLWithOptions retrieves a declarative configuration source from an HTTP(S) URL using the provided options.
func ResolveReferences ¶ added in v0.1.5
func ResolveReferences(ctx context.Context, rs *resources.ResourceSet) error
ResolveReferences resolves explicit scalar references throughout registered declarations.
func ValidateYAMLFile ¶
ValidateYAMLFile checks if a file has a valid YAML extension
Types ¶
type ExpandedDocument ¶ added in v1.28.0
type ExpandedDocument struct {
SourcePath string
// Content is the expanded YAML; line numbers refer to it, not to the source.
Content []byte
// Empty is true when nothing remains once _templates is removed, such as a
// file that only defines templates.
Empty bool
}
ExpandedDocument is an input document after local !file content is included and _templates/_extends are expanded. !env, !ref, !secret and lookup tags remain unresolved placeholders.
type FieldResolver ¶ added in v0.1.5
type FieldResolver interface {
// ResolveField extracts a field value from a resource
ResolveField(resource resources.Resource, field string) (string, error)
// CanResolve checks if this resolver can handle the given resource type
CanResolve(resourceType string) bool
}
FieldResolver interface for field resolution
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader handles loading declarative configuration from files
func NewWithBaseDir ¶ added in v0.3.6
NewWithBaseDir creates a new configuration loader with a base directory for !file boundaries
func NewWithPath ¶
NewWithPath creates a new configuration loader with a root path (deprecated, for backward compatibility)
func (*Loader) ExpandSources ¶ added in v1.28.0
func (l *Loader) ExpandSources(ctx context.Context, sources []Source, recursive bool) ([]ExpandedDocument, error)
ExpandSources runs the same preprocessing as LoadFromSources up to and including template expansion. It does not parse resources, apply defaults, resolve references, validate resource types, read environment values or fetch secrets. YAML, tag declarations and template syntax are checked. Scalar and list inputs are supported as fragments; multiple YAML documents per input are rejected.
func (*Loader) Load ¶
func (l *Loader) Load() (*resources.ResourceSet, error)
Load loads configuration from the default current directory (deprecated)
func (*Loader) LoadFile ¶
func (l *Loader) LoadFile(path string) (*resources.ResourceSet, error)
LoadFile loads configuration from a single YAML file (deprecated, for backward compatibility)
func (*Loader) LoadFromSources ¶
LoadFromSources loads configuration from multiple sources
func (*Loader) LoadFromSourcesWithContext ¶ added in v0.1.5
func (l *Loader) LoadFromSourcesWithContext(ctx context.Context, sources []Source, recursive bool, ) (*resources.ResourceSet, error)
LoadFromSourcesWithContext loads configuration from multiple sources with context support
func (*Loader) WithStdin ¶ added in v1.28.0
WithStdin supplies the reader for stdin sources. Without it, the loader uses os.Stdin.
func (*Loader) WithURLFetchOptions ¶ added in v1.3.0
func (l *Loader) WithURLFetchOptions(options URLFetchOptions) *Loader
WithURLFetchOptions configures remote URL source fetching.
type LocalFieldResolver ¶ added in v0.1.5
type LocalFieldResolver struct {
// contains filtered or unexported fields
}
LocalFieldResolver resolves fields from local ResourceSet
func NewLocalFieldResolver ¶ added in v0.1.5
func NewLocalFieldResolver(logger *slog.Logger) *LocalFieldResolver
NewLocalFieldResolver creates a new local field resolver
func (*LocalFieldResolver) CanResolve ¶ added in v0.1.5
func (r *LocalFieldResolver) CanResolve(_ string) bool
CanResolve checks if this resolver can handle the resource type
func (*LocalFieldResolver) ResolveField ¶ added in v0.1.5
func (r *LocalFieldResolver) ResolveField(resource resources.Resource, field string) (string, error)
ResolveField extracts field value using reflection
type PrincipalCSVSummary ¶ added in v1.27.0
type PrincipalCSVSummary struct {
Rows int `json:"rows" yaml:"rows"`
Identities int `json:"identities" yaml:"identities"`
APIKeys int `json:"api_keys" yaml:"api_keys"`
BasicAuths int `json:"basic_auths" yaml:"basic_auths"`
MetadataMode string `json:"metadata_mode" yaml:"metadata_mode"`
RemoteStateChecked bool `json:"remote_state_checked" yaml:"remote_state_checked"`
}
PrincipalCSVSummary contains structural counts only; it does not establish remote membership, management authority or runtime credential validity.
func InspectPrincipalCSV ¶ added in v1.27.0
func InspectPrincipalCSV(path, mode string) (*PrincipalCSVSummary, error)
InspectPrincipalCSV validates a bounded local CSV without contacting Konnect.
type Source ¶
type Source struct {
Path string
Type SourceType
}
Source represents a configuration source with its type
func ParseSources ¶
ParseSources parses the filename flag values into individual sources
type SourceType ¶
type SourceType int
SourceType represents the type of configuration source
const ( // SourceTypeFile represents a single file source SourceTypeFile SourceType = iota // SourceTypeDirectory represents a directory source SourceTypeDirectory // SourceTypeSTDIN represents stdin source SourceTypeSTDIN // SourceTypeURL represents an HTTP(S) URL source SourceTypeURL )
type URLFetchAuthPolicy ¶ added in v1.3.0
type URLFetchAuthPolicy string
URLFetchAuthPolicy controls when remote declarative URL fetches may include authentication.
const ( // URLFetchAuthAuto sends the configured bearer token only to HTTPS URLs whose host is explicitly allowed. URLFetchAuthAuto URLFetchAuthPolicy = "auto" // URLFetchAuthNone disables authentication for remote declarative URL fetches. URLFetchAuthNone URLFetchAuthPolicy = "none" )
type URLFetchOptions ¶ added in v1.3.0
type URLFetchOptions struct {
AuthPolicy URLFetchAuthPolicy
AuthAllowedHosts []string
TokenSource URLFetchTokenSource
}
URLFetchOptions controls remote declarative URL fetch behavior that should be selected by the command layer.
func (URLFetchOptions) AllowsAuthenticationForURL ¶ added in v1.3.0
func (o URLFetchOptions) AllowsAuthenticationForURL(rawURL string) bool
AllowsAuthenticationForURL reports whether the URL is within the configured authentication boundary.
Source Files
¶
- config_templates.go
- content_metadata.go
- deck_config_paths.go
- env_namespace.go
- env_resolution.go
- env_sources.go
- env_store.go
- env_validation.go
- expand.go
- identity_principal_csv.go
- load_schema.go
- loader.go
- ref_resolver.go
- reference_literals.go
- secret_sources.go
- source_documents.go
- sources.go
- sync_scope.go
- url_fetcher.go
- validator.go