responses

package
v0.27.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateAPIKey added in v0.16.0

type CreateAPIKey struct {
	ID        string          `json:"id"`
	Name      string          `json:"name"`
	UserID    string          `json:"user_id"`
	TenantID  string          `json:"tenant_id"`
	Role      authorizer.Role `json:"role" validate:"required,oneof=administrator operator observer"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
	ExpiresIn int64           `json:"expires_in"`
}

func CreateAPIKeyFromModel added in v0.16.0

func CreateAPIKeyFromModel(m *models.APIKey) *CreateAPIKey

type CreateInstallKey

type CreateInstallKey struct {
	// Key is the plaintext install key. It is shown at creation and afterwards only via reveal.
	Key        string     `json:"key"`
	Name       string     `json:"name"`
	UserID     string     `json:"user_id"`
	TenantID   string     `json:"tenant_id"`
	Reusable   bool       `json:"reusable"`
	UsageLimit int        `json:"usage_limit"`
	UsedTimes  int        `json:"used_times"`
	LastUsedAt *time.Time `json:"last_used_at"`
	Ephemeral  bool       `json:"ephemeral"`
	Tags       []string   `json:"tags"`
	Revoked    bool       `json:"revoked"`
	CreatedAt  time.Time  `json:"created_at"`
	UpdatedAt  time.Time  `json:"updated_at"`
	ExpiresAt  *time.Time `json:"expires_at"`
}

CreateInstallKey is returned once, at creation. It carries the plaintext key, which afterwards can only be seen again through the reveal endpoint.

func CreateInstallKeyFromModel

func CreateInstallKeyFromModel(m *models.InstallKey) *CreateInstallKey

CreateInstallKeyFromModel maps a model into the create response. The plaintext key must be placed into m.ID by the caller before mapping (the stored model only ever holds the hash).

type PublicKeyCreate

type PublicKeyCreate struct {
	Data        []byte          `json:"data"`
	Filter      PublicKeyFilter `json:"filter"`
	Name        string          `json:"name"`
	Username    string          `json:"username"`
	TenantID    string          `json:"tenant_id"`
	Fingerprint string          `json:"fingerprint"`
}

PublicKeyCreate is the structure to represent the request data for create public key endpoint.

type PublicKeyFilter

type PublicKeyFilter struct {
	Hostname string `json:"hostname,omitempty" validate:"required_without=Tags,excluded_with=Tags,regexp"`
	// FIXME: add validation for tags when it has at least one item.
	//
	// If used `min=1` to do that validation, when tags is empty, its zero value, and only hostname is provided,
	// it throws a error even with `required_without` and `excluded_with`.
	Tags []string `` /* 142-byte string literal not displayed */
}

type RevealInstallKey

type RevealInstallKey struct {
	Key string `json:"key"`
}

RevealInstallKey carries a install key's plaintext, decrypted on demand from its at-rest ciphertext.

Jump to

Keyboard shortcuts

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