secret

package
v1.21.9 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountSecrets added in v1.21.0

func CountSecrets(ctx context.Context, opts *FindSecretsOptions) (int64, error)

CountSecrets counts the secrets

func GetSecretsOfTask added in v1.21.9

func GetSecretsOfTask(ctx context.Context, task *actions_model.ActionTask) (map[string]string, error)

func UpdateSecret added in v1.21.0

func UpdateSecret(ctx context.Context, secretID int64, data string) error

UpdateSecret changes org or user reop secret.

Types

type ErrSecretNotFound added in v1.21.0

type ErrSecretNotFound struct {
	Name string
}

ErrSecretNotFound represents a "secret not found" error.

func (ErrSecretNotFound) Error added in v1.21.0

func (err ErrSecretNotFound) Error() string

func (ErrSecretNotFound) Unwrap added in v1.21.0

func (err ErrSecretNotFound) Unwrap() error

type FindSecretsOptions

type FindSecretsOptions struct {
	db.ListOptions
	OwnerID  int64
	RepoID   int64
	SecretID int64
	Name     string
}

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

Jump to

Keyboard shortcuts

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