Documentation
¶
Overview ¶
Package secrets_sync provides Python bindings for the secrets-sync pipeline.
This package exposes the core secrets synchronization functionality for use from Python via gopy-generated bindings.
Index ¶
- Constants
- type ConfigInfo
- type PipelineConfig
- type ProviderSession
- type StringListResult
- type SyncOptions
- type SyncResult
- func DryRun(configPath string) *SyncResult
- func DryRunWithSession(configPath string, session *ProviderSession) *SyncResult
- func Merge(configPath string, dryRun bool) *SyncResult
- func MergeWithSession(configPath string, dryRun bool, session *ProviderSession) *SyncResult
- func RunPipeline(configPath string, opts *SyncOptions) *SyncResult
- func RunPipelineWithSession(configPath string, opts *SyncOptions, session *ProviderSession) *SyncResult
- func Sync(configPath string, dryRun bool) *SyncResult
- func SyncWithSession(configPath string, dryRun bool, session *ProviderSession) *SyncResult
- type ValidationResult
Constants ¶
const ( OperationPipeline = "pipeline" OperationMerge = "merge" OperationSync = "sync" )
Operation constants for Python clients.
const ( OutputFormatHuman = "human" OutputFormatJSON = "json" OutputFormatGitHub = "github" OutputFormatCompact = "compact" OutputFormatSideBySide = "side-by-side" )
OutputFormat constants for Python clients.
const Version = "0.1.0"
Version of the Python binding API contract. Wheel release versions are patched from the release tag during packaging.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigInfo ¶
type ConfigInfo struct {
Valid bool // Whether the configuration is valid.
ErrorMessage string // Error message if invalid.
SourceCount int // Number of sources.
TargetCount int // Number of targets.
Sources []string // List of source names, sorted alphabetically.
Targets []string // List of target names, sorted alphabetically.
HasMergeStore bool // Whether a merge store is configured.
VaultAddress string // Vault address if configured.
AWSRegion string // AWS region if configured.
}
ConfigInfo returns information about a configuration file.
func GetConfigInfo ¶
func GetConfigInfo(configPath string) *ConfigInfo
GetConfigInfo returns detailed information about a configuration.
type PipelineConfig ¶
type PipelineConfig struct {
Path string // Path to YAML configuration file.
}
PipelineConfig represents a pipeline configuration in a Python-friendly format.
func NewPipelineConfig ¶
func NewPipelineConfig(path string) *PipelineConfig
NewPipelineConfig creates a new pipeline configuration from a file path.
type ProviderSession ¶
type ProviderSession struct {
DelegateAuth bool // If true, ignore explicit session fields and let secrets-sync authenticate.
VaultAddress string // Vault address for an upstream-owned Vault session.
VaultNamespace string // Vault namespace for the upstream-owned Vault session.
VaultToken string // Vault token for the upstream-owned Vault session.
AWSRegion string // AWS region for the upstream-owned AWS session.
AWSAccessKeyID string // AWS access key ID for the upstream-owned AWS session.
AWSSecretAccessKey string // AWS secret access key for the upstream-owned AWS session.
AWSSessionToken string // AWS session token for temporary credentials.
AWSRoleARN string // Optional role ARN to assume from the supplied AWS session.
AWSEndpointURL string // Optional AWS endpoint override for local or custom providers.
}
ProviderSession carries authenticated provider material from an upstream Python package into the Go runtime. Set DelegateAuth to true when the caller wants secrets-sync to use its normal environment/config authentication path.
func NewProviderSession ¶
func NewProviderSession() *ProviderSession
NewProviderSession creates an empty provider session.
type StringListResult ¶
type StringListResult struct {
Success bool // Whether the list was read successfully.
ErrorMessage string // Error message if the read failed.
Values []string // Sorted values.
}
StringListResult represents a named list returned through gopy.
func GetSources ¶
func GetSources(configPath string) *StringListResult
GetSources returns the source names from a configuration, sorted alphabetically.
func GetTargets ¶
func GetTargets(configPath string) *StringListResult
GetTargets returns the target names from a configuration, sorted alphabetically.
type SyncOptions ¶
type SyncOptions struct {
DryRun bool // If true, do not make actual changes.
Operation string // "merge", "sync", or "pipeline".
Targets string // Comma-separated list of targets. Empty means all targets.
ContinueOnError bool // Continue on errors.
Parallelism int // Number of parallel operations.
ComputeDiff bool // Compute and return diff.
OutputFormat string // "human", "json", "github", "compact", or "side-by-side".
ShowValues bool // If true, show unmasked secret values in diff output.
}
SyncOptions configures pipeline execution.
func DefaultSyncOptions ¶
func DefaultSyncOptions() *SyncOptions
DefaultSyncOptions returns sensible default options.
type SyncResult ¶
type SyncResult struct {
Success bool // Overall success status.
TargetCount int // Number of targets processed.
SecretsProcessed int // Total secrets processed.
SecretsAdded int // Secrets added.
SecretsModified int // Secrets modified.
SecretsRemoved int // Secrets removed.
SecretsUnchanged int // Secrets unchanged.
DurationMs int64 // Duration in milliseconds.
ErrorMessage string // Error message if failed.
ResultsJSON string // Full results as JSON.
DiffOutput string // Diff output if computed.
}
SyncResult represents the outcome of a sync operation.
func DryRun ¶
func DryRun(configPath string) *SyncResult
DryRun performs a dry run of the pipeline and returns the diff.
func DryRunWithSession ¶
func DryRunWithSession(configPath string, session *ProviderSession) *SyncResult
DryRunWithSession performs a dry run with caller-supplied provider session material.
func Merge ¶
func Merge(configPath string, dryRun bool) *SyncResult
Merge runs only the merge phase of the pipeline.
func MergeWithSession ¶
func MergeWithSession(configPath string, dryRun bool, session *ProviderSession) *SyncResult
MergeWithSession runs only the merge phase with caller-supplied provider session material.
func RunPipeline ¶
func RunPipeline(configPath string, opts *SyncOptions) *SyncResult
RunPipeline executes the secrets synchronization pipeline.
func RunPipelineWithSession ¶
func RunPipelineWithSession(configPath string, opts *SyncOptions, session *ProviderSession) *SyncResult
RunPipelineWithSession executes the pipeline with caller-supplied provider session material.
func Sync ¶
func Sync(configPath string, dryRun bool) *SyncResult
Sync runs only the sync phase of the pipeline.
func SyncWithSession ¶
func SyncWithSession(configPath string, dryRun bool, session *ProviderSession) *SyncResult
SyncWithSession runs only the sync phase with caller-supplied provider session material.
type ValidationResult ¶
type ValidationResult struct {
Valid bool // Whether the configuration is valid.
Message string // Human-readable validation message.
ErrorMessage string // Error message if validation failed.
}
ValidationResult represents configuration validation status.
func ValidateConfig ¶
func ValidateConfig(configPath string) *ValidationResult
ValidateConfig validates a pipeline configuration file.