secret

package
v0.0.0-...-8bea463 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnmanagedSecret = errUnmanagedSecret{}

Functions

func Delete

func Delete(ctx context.Context, teamSlug slug.Slug, environment, name string) error

func NewLoaderContext

func NewLoaderContext(ctx context.Context, clientCreator ClientCreator, environments []string, log logrus.FieldLogger) context.Context

Types

type AddSecretValueInput

type AddSecretValueInput struct {
	Name        string            `json:"name"`
	Environment string            `json:"environment"`
	Team        slug.Slug         `json:"team"`
	Value       *SecretValueInput `json:"value"`
}

type AddSecretValuePayload

type AddSecretValuePayload struct {
	Secret *Secret `json:"secret"`
}

type ClientCreator

type ClientCreator func(ctx context.Context, environment string) (dynamic.NamespaceableResourceInterface, error)

func CreatorFromClients

func CreatorFromClients(clients map[string]dynamic.Interface) ClientCreator

func CreatorFromConfig

func CreatorFromConfig(ctx context.Context, configs map[string]*rest.Config) ClientCreator

type CreateSecretInput

type CreateSecretInput struct {
	Name        string    `json:"name"`
	Environment string    `json:"environment"`
	Team        slug.Slug `json:"team"`
}

type CreateSecretPayload

type CreateSecretPayload struct {
	Secret *Secret `json:"secret"`
}

type DeleteSecretInput

type DeleteSecretInput struct {
	Name        string    `json:"name"`
	Environment string    `json:"environment"`
	Team        slug.Slug `json:"team"`
}

type DeleteSecretPayload

type DeleteSecretPayload struct {
	SecretDeleted bool `json:"secretDeleted"`
}

type RemoveSecretValueInput

type RemoveSecretValueInput struct {
	SecretName  string    `json:"secretName"`
	Environment string    `json:"environment"`
	Team        slug.Slug `json:"team"`
	ValueName   string    `json:"valueName"`
}

type RemoveSecretValuePayload

type RemoveSecretValuePayload struct {
	Secret *Secret `json:"secret"`
}

type Secret

type Secret struct {
	Name                string     `json:"name"`
	LastModifiedAt      *time.Time `json:"lastModifiedAt"`
	ModifiedByUserEmail *string    `json:"lastModifiedBy"`

	TeamSlug        slug.Slug `json:"-"`
	EnvironmentName string    `json:"-"`
}

func AddSecretValue

func AddSecretValue(ctx context.Context, teamSlug slug.Slug, environment, secretName string, valueToAdd *SecretValueInput) (*Secret, error)

func Create

func Create(ctx context.Context, teamSlug slug.Slug, environment, name string) (*Secret, error)

func Get

func Get(ctx context.Context, teamSlug slug.Slug, environment, name string) (*Secret, error)

func GetByIdent

func GetByIdent(ctx context.Context, id ident.Ident) (*Secret, error)

func RemoveSecretValue

func RemoveSecretValue(ctx context.Context, teamSlug slug.Slug, environment, secretName, valueName string) (*Secret, error)

func UpdateSecretValue

func UpdateSecretValue(ctx context.Context, teamSlug slug.Slug, environment, secretName string, valueToUpdate *SecretValueInput) (*Secret, error)

func (*Secret) DeepCopyObject

func (s *Secret) DeepCopyObject() runtime.Object

func (*Secret) GetLabels

func (s *Secret) GetLabels() map[string]string

func (*Secret) GetName

func (s *Secret) GetName() string

func (*Secret) GetNamespace

func (s *Secret) GetNamespace() string

func (*Secret) GetObjectKind

func (s *Secret) GetObjectKind() schema.ObjectKind

func (*Secret) ID

func (s *Secret) ID() ident.Ident

func (Secret) IsNode

func (Secret) IsNode()

type SecretConnection

type SecretConnection = pagination.Connection[*Secret]

func ListForTeam

func ListForTeam(ctx context.Context, teamSlug slug.Slug, page *pagination.Pagination, orderBy *SecretOrder, filter *SecretFilter) (*SecretConnection, error)

func ListForWorkload

func ListForWorkload(ctx context.Context, teamSlug slug.Slug, environmentName string, workload workload.Workload, page *pagination.Pagination) (*SecretConnection, error)

type SecretCreatedActivityLogEntry

type SecretCreatedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
}

type SecretDeletedActivityLogEntry

type SecretDeletedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
}

type SecretEdge

type SecretEdge = pagination.Edge[*Secret]

type SecretFilter

type SecretFilter struct {
	// Filter by usage of the secret.
	InUse *bool `json:"inUse"`
}

Input for filtering the secrets of a team.

type SecretOrder

type SecretOrder struct {
	// The field to order items by.
	Field SecretOrderField `json:"field"`
	// The direction to order items by.
	Direction model.OrderDirection `json:"direction"`
}

type SecretOrderField

type SecretOrderField string
const (
	// Order secrets by name.
	SecretOrderFieldName SecretOrderField = "NAME"
	// Order secrets by the name of the environment.
	SecretOrderFieldEnvironment SecretOrderField = "ENVIRONMENT"
	// Order secrets by the last time it was modified.
	SecretOrderFieldLastModifiedAt SecretOrderField = "LAST_MODIFIED_AT"
)

func (SecretOrderField) IsValid

func (e SecretOrderField) IsValid() bool

func (SecretOrderField) MarshalGQL

func (e SecretOrderField) MarshalGQL(w io.Writer)

func (SecretOrderField) String

func (e SecretOrderField) String() string

func (*SecretOrderField) UnmarshalGQL

func (e *SecretOrderField) UnmarshalGQL(v interface{}) error

type SecretValue

type SecretValue struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

func GetSecretValues

func GetSecretValues(ctx context.Context, teamSlug slug.Slug, environmentName, name string) ([]*SecretValue, error)

type SecretValueAddedActivityLogEntryData

type SecretValueAddedActivityLogEntryData struct {
	ValueName string
}

type SecretValueInput

type SecretValueInput struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type SecretValueRemovedActivityLogEntryData

type SecretValueRemovedActivityLogEntryData struct {
	ValueName string
}

type SecretValueUpdatedActivityLogEntryData

type SecretValueUpdatedActivityLogEntryData struct {
	ValueName string
}

type SecretVariableInput

type SecretVariableInput struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type UpdateSecretInput

type UpdateSecretInput struct {
	Name        string                 `json:"name"`
	Environment string                 `json:"environment"`
	Team        slug.Slug              `json:"team"`
	Data        []*SecretVariableInput `json:"data"`
}

type UpdateSecretPayload

type UpdateSecretPayload struct {
	Secret *Secret `json:"secret"`
}

type UpdateSecretValueInput

type UpdateSecretValueInput struct {
	Name        string            `json:"name"`
	Environment string            `json:"environment"`
	Team        slug.Slug         `json:"team"`
	Value       *SecretValueInput `json:"value"`
}

type UpdateSecretValuePayload

type UpdateSecretValuePayload struct {
	Secret *Secret `json:"secret"`
}

Jump to

Keyboard shortcuts

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