vault

package
v2.42.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Secret

type Secret struct {
	SecretRequest
	Created   time.Time `json:"created"`
	Updated   time.Time `json:"updated"`
	UpdatedBy string    `json:"updated_by"`
	Author    string    `json:"author"`
	Path      string    `json:"path"`
}

Secret secret definition.

type SecretCreate

type SecretCreate struct {
	Name string `json:"name"`
}

SecretCreate secret create create response definition.

type SecretRequest

type SecretRequest struct {
	Name       string                  `json:"name"`
	ReadRoles  []rolestore.RoleHandle  `json:"read_roles"`
	WriteRoles []rolestore.RoleHandle  `json:"write_roles"`
	Data       *map[string]interface{} `json:"data,omitempty"`
	OwnerID    string                  `json:"owner_id,omitempty"`
}

SecretRequest secret request definition.

type SecretSearch

type SecretSearch struct {
	Keywords string   `json:"keywords"`
	SortDir  string   `json:"sortdir"`
	SortKey  string   `json:"sortkey"`
	Filter   string   `json:"filter"`
	OwnerIDs []string `json:"owner_id"`
	Limit    int      `json:"limit"`
	Offset   int      `json:"offset"`
}

SecretSearch secret search request definition.

type Vault

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

Vault is a vault client instance.

func New

func New(api restapi.Connector) *Vault

New vault client constructor.

func (*Vault) CreateSecret

func (c *Vault) CreateSecret(secret *SecretRequest) (SecretCreate, error)

CreateSecret create secret.

func (*Vault) CreateUserSecret

func (c *Vault) CreateUserSecret(userID string, secret *SecretRequest) (SecretCreate, error)

CreateUserSecret create user secret.

func (*Vault) DeleteSecret

func (c *Vault) DeleteSecret(secretName string) error

DeleteSecret delete secret.

func (*Vault) DeleteUserSecret

func (c *Vault) DeleteUserSecret(userID, secretName string) error

DeleteUserSecret delete user secret.

func (*Vault) GetSchemas

func (c *Vault) GetSchemas() (*json.RawMessage, error)

MARK: Schemas GetSchemas get the defined vault schemas.

func (*Vault) GetSecret

func (c *Vault) GetSecret(secretName string) (*Secret, error)

GetSecret get secret by secret name.

func (*Vault) GetSecrets

func (c *Vault) GetSecrets(opts ...filters.Option) (*response.ResultSet[Secret], error)

MARK: Secrets GetSecrets get secrets.

func (*Vault) GetSecretsMetadata

func (c *Vault) GetSecretsMetadata(name string) (*Secret, error)

MARK: Metadata GetSecretsMetadata get secrets metadata.

func (*Vault) GetUserSecret

func (c *Vault) GetUserSecret(userID, secretName string) (*Secret, error)

UserSecret get user secret by secret name.

func (*Vault) GetUserSecrets

func (c *Vault) GetUserSecrets(userID string, opts ...filters.Option) (*response.ResultSet[Secret], error)

MARK: Personal Secrets GetUserSecrets get user secrets.

func (*Vault) GetUsersSecretsMetadata

func (c *Vault) GetUsersSecretsMetadata(userID, name string) (*Secret, error)

GetUsersSecretsMetadata get users secrets metadata.

func (*Vault) SearchSecrets

func (c *Vault) SearchSecrets(search SecretSearch, opts ...filters.Option) (*response.ResultSet[Secret], error)

SearchSecrets search secrets.

func (*Vault) Status

func (c *Vault) Status() (*response.ServiceStatus, error)

MARK: Status Status get role store microservice status.

func (*Vault) UpdateSecret

func (c *Vault) UpdateSecret(secretName string, secret *SecretRequest) error

UpdateSecret update secret.

func (*Vault) UpdateUserSecret

func (c *Vault) UpdateUserSecret(userID, secretName string, secret *SecretRequest) error

UpdateUserSecret update user secret.

Jump to

Keyboard shortcuts

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