secret

package
v1.17.4 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrSecretInvalidValue

type ErrSecretInvalidValue struct {
	Name *string
	Data *string
}

func (ErrSecretInvalidValue) Error

func (err ErrSecretInvalidValue) Error() string

func (ErrSecretInvalidValue) Unwrap

func (err ErrSecretInvalidValue) Unwrap() error

type FindSecretsOptions

type FindSecretsOptions struct {
	db.ListOptions
	OwnerID int64
	RepoID  int64
}

type Secret

type Secret struct {
	ID          int64
	OwnerID     int64              `xorm:"INDEX UNIQUE(owner_repo_name) NOT NULL"`
	RepoID      int64              `xorm:"INDEX UNIQUE(owner_repo_name) NOT NULL DEFAULT 0"`
	Name        string             `xorm:"UNIQUE(owner_repo_name) NOT NULL"`
	Data        string             `xorm:"LONGTEXT"` // encrypted data
	CreatedUnix timeutil.TimeStamp `xorm:"created NOT NULL"`
}

Secret represents a secret

func FindSecrets

func FindSecrets(ctx context.Context, opts FindSecretsOptions) ([]*Secret, error)

func InsertEncryptedSecret

func InsertEncryptedSecret(ctx context.Context, ownerID, repoID int64, name, data string) (*Secret, error)

InsertEncryptedSecret Creates, encrypts, and validates a new secret with yet unencrypted data and insert into database

func (*Secret) Validate

func (s *Secret) Validate() error

Validate validates the required fields and formats.

Jump to

Keyboard shortcuts

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