Documentation
¶
Overview ¶
Package secret contains the team secret registry domain model.
Index ¶
- Constants
- Variables
- func IsGlobalWorkspace(name string) bool
- func NormalizeWorkspace(name string) string
- func ProviderRefFingerprint(key string, providerType ProviderType, ...) (string, error)
- func ValidateProviderType(providerType ProviderType) error
- func ValidateRef(ref string) error
- func ValidateWorkspace(name string) error
- type CreateInput
- type ListOptions
- type ProviderType
- type ReferenceResolver
- type Secret
- type Status
- type Store
- type UpdateInput
- type VersionMetadata
- type WriteValueInput
Constants ¶
View Source
const ( // GlobalWorkspace is the internal scope for secrets that are intentionally // shared across DAG workspaces. It is not a valid workspace name. GlobalWorkspace = ".global" )
Variables ¶
View Source
var ( ErrAlreadyExists = errors.New("secret already exists") ErrDisabled = errors.New("secret is disabled") ErrInvalidProviderType = errors.New("invalid secret provider type") ErrInvalidRef = errors.New("invalid secret ref") ErrInvalidSecretID = errors.New("invalid secret id") ErrInvalidStatus = errors.New("invalid secret status") ErrInvalidWorkspace = errors.New("invalid secret workspace") ErrNoValue = errors.New("secret has no value") ErrNotFound = errors.New("secret not found") ErrUnsupportedProvider = errors.New("secret provider is not supported for registry resolution") )
Functions ¶
func IsGlobalWorkspace ¶
func NormalizeWorkspace ¶
func ProviderRefFingerprint ¶
func ProviderRefFingerprint(key string, providerType ProviderType, providerConnectionID, providerRef string) (string, error)
func ValidateProviderType ¶
func ValidateProviderType(providerType ProviderType) error
func ValidateRef ¶
func ValidateWorkspace ¶
Types ¶
type CreateInput ¶
type ListOptions ¶
type ListOptions struct {
// Workspace filters by internal workspace name. Nil means all scopes.
// A pointer to GlobalWorkspace means the global scope.
Workspace *string
}
type ProviderType ¶
type ProviderType string
const ( ProviderDaguManaged ProviderType = "dagu-managed" ProviderVault ProviderType = "vault" ProviderKubernetes ProviderType = "kubernetes" ProviderGCP ProviderType = "gcp" ProviderAWS ProviderType = "aws" ProviderAzure ProviderType = "azure" ProviderAlibaba ProviderType = "alibaba" )
type ReferenceResolver ¶
type ReferenceResolver struct {
// contains filtered or unexported fields
}
func NewReferenceResolver ¶
func NewReferenceResolver(store Store, workspace string) *ReferenceResolver
func (*ReferenceResolver) CheckReferenceAccessibility ¶
func (*ReferenceResolver) ResolveReference ¶
type Secret ¶
type Secret struct {
ID string
Workspace string
Ref string
Description string
ProviderType ProviderType
ProviderConnectionID string
ProviderRef string
ProviderRefFingerprint string
CurrentVersion int
Status Status
CreatedBy string
CreatedAt time.Time
UpdatedBy string
UpdatedAt time.Time
LastCheckedAt *time.Time
LastResolvedAt *time.Time
LastRotatedAt *time.Time
}
Secret is the registry metadata for a scoped secret reference. It never contains plaintext secret values.
func (*Secret) ApplyUpdate ¶
func (s *Secret) ApplyUpdate(input UpdateInput, now time.Time)
type Store ¶
type Store interface {
Create(ctx context.Context, secret *Secret, initialValue *WriteValueInput) error
GetByID(ctx context.Context, id string) (*Secret, error)
GetByRef(ctx context.Context, workspace, ref string) (*Secret, error)
List(ctx context.Context, opts ListOptions) ([]*Secret, error)
Update(ctx context.Context, secret *Secret) error
Delete(ctx context.Context, id string) error
WriteValue(ctx context.Context, id string, input WriteValueInput) (*Secret, error)
GetCurrentVersion(ctx context.Context, id string) (*VersionMetadata, error)
ResolveValue(ctx context.Context, id string) (string, *VersionMetadata, error)
}
type UpdateInput ¶
type VersionMetadata ¶
Click to show internal directories.
Click to hide internal directories.