Help us shape the future of Go! Take the 2026 Go Developer Survey

credential

package
v0.96.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry maps credential aliases to secret URLs (for example op:// references). The map is populated from the root workflow's credentialMap; it is empty until Set is called.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates an empty registry.

func (*Registry) HasMap

func (r *Registry) HasMap() bool

HasMap reports whether at least one alias is registered.

func (*Registry) Resolve

func (r *Registry) Resolve(alias string) (string, error)

Resolve returns the secret URL for alias. URLs and unmapped aliases pass through unchanged.

func (*Registry) Set

func (r *Registry) Set(m map[string]string)

Set replaces the registry contents with m. Empty aliases or URLs are skipped.

type SecretLookup

type SecretLookup interface {
	Lookup(ctx context.Context, resource secret.Resource) (*scy.Secret, error)
	Expand(ctx context.Context, input string, secrets map[secret.Key]secret.Resource) (string, error)
	GetCredentials(ctx context.Context, resource string) (*cred.Generic, error)
	GeyKey(ctx context.Context, resource string) (*cred.SecretKey, error)
}

SecretLookup is the secret surface used by endly workflow context.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service wraps scy secret lookup with e2e alias resolution.

func NewService

func NewService(opts ...secret.Option) *Service

NewService creates a secret service that resolves e2e credential aliases before lookup.

func (*Service) Expand

func (s *Service) Expand(ctx context.Context, input string, secrets map[secret.Key]secret.Resource) (string, error)

Expand expands secret placeholders after resolving configured aliases.

func (*Service) GetCredentials

func (s *Service) GetCredentials(ctx context.Context, resource string) (*cred.Generic, error)

GetCredentials returns credentials for resource after alias resolution.

func (*Service) GeyKey

func (s *Service) GeyKey(ctx context.Context, resource string) (*cred.SecretKey, error)

GeyKey returns secret key for resource after alias resolution.

func (*Service) HasCredentialMap

func (s *Service) HasCredentialMap() bool

HasCredentialMap reports whether a credential map has been registered.

func (*Service) Lookup

func (s *Service) Lookup(ctx context.Context, resource secret.Resource) (*scy.Secret, error)

Lookup loads a secret after resolving e2e aliases.

func (*Service) ResolveAlias

func (s *Service) ResolveAlias(alias string) (string, error)

ResolveAlias returns the mapped URL for alias, or the alias unchanged when unmapped.

func (*Service) SetCredentialMap

func (s *Service) SetCredentialMap(m map[string]string)

SetCredentialMap registers alias → URL mappings from the root workflow credentialMap.

Jump to

Keyboard shortcuts

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