dataservicecredentials

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCredential = errors.New("invalid data service credential")
	ErrCredentialMissing = errors.New("data service credential is not configured")
)

Functions

func IsMissing

func IsMissing(err error) bool

Types

type Input

type Input struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Material

type Material struct {
	Username string
	Password string
}

type PublicInfo

type PublicInfo struct {
	ServiceKey string    `json:"service_key"`
	Username   string    `json:"username"`
	Configured bool      `json:"configured"`
	UpdatedBy  string    `json:"updated_by"`
	UpdatedAt  time.Time `json:"updated_at"`
}

type Service

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

func New

func New(config *appconfig.Config, store Store) (*Service, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, project, environment, service string) error

func (*Service) List

func (s *Service) List(ctx context.Context, project, environment string) ([]PublicInfo, error)

func (*Service) Materials

func (s *Service) Materials(ctx context.Context, project, environment string) (map[string]Material, error)

func (*Service) Save

func (s *Service) Save(ctx context.Context, project, environment, service, updatedBy string, input Input) (PublicInfo, error)

type Store

type Store interface {
	ListDataServiceCredentials(context.Context, string, string) ([]StoredCredential, error)
	GetDataServiceCredential(context.Context, string, string, string) (StoredCredential, error)
	SaveDataServiceCredential(context.Context, StoredCredential) error
	DeleteDataServiceCredential(context.Context, string, string, string) error
}

type StoredCredential

type StoredCredential struct {
	ProjectKey, EnvironmentKey, ServiceKey string
	Username, PasswordCipher, UpdatedBy    string
	CreatedAt, UpdatedAt                   time.Time
}

Jump to

Keyboard shortcuts

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