token

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name     string     `yaml:"name" validate:"required"`
	State    TokenState `yaml:"state" validate:"required"`
	Rotation *Rotation  `yaml:"rotation,omitempty"`
	Source   Source     `yaml:"source" validate:"required"`
	Vault    Vault      `yaml:"vault" validate:"required"`
}

Config defines settings for a specific token.

type Rotation

type Rotation struct {
	RotateBefore time.Duration `yaml:"rotate_before" validate:"required"`
	Validity     time.Duration `yaml:"validity" validate:"required"`
}

Rotation defines the validity and

type Source

type Source struct {
	Name        string   `yaml:"name" validate:"required"`
	Description string   `yaml:"description"`
	Type        string   `yaml:"type" validate:"required"` // personal, project, group, ...
	Owner       string   `yaml:"owner"`                    // user/project/group ID or full name
	Role        string   `yaml:"role"`
	Scopes      []string `yaml:"scopes" validate:"required"`
}

Source defines the source of a token.

type Status

type Status struct {
	SourceID  string `yaml:"token_id"`
	VaultID   string `yaml:"vault_id"`
	ItemID    string `yaml:"item_id"`
	ExpiresAt string `yaml:"expires_at"`
}

Status represents the status of a token synchronization.

type Token

type Token struct {
	Name        string
	Description string
	Scopes      []string
	Type        string
	Owner       string
	Value       string
	Expiration  time.Time
}

type TokenState

type TokenState string
const (
	TokenStateActive   TokenState = "active"
	TokenStateInactive TokenState = "inactive"
	TokenStateDeleted  TokenState = "deleted"
)

type Vault

type Vault struct {
	Path  string `yaml:"path" validate:"required"`
	Item  string `yaml:"item" validate:"required"`
	Field string `yaml:"field" validate:"required"`
}

Vault defines the target vault item for a token.

Jump to

Keyboard shortcuts

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