apikey

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	ID          string            `json:"id" doc:"Unique identifier of the API key"`
	Name        string            `json:"name" doc:"Name of the API key"`
	Description *string           `json:"description,omitempty" doc:"Description of the API key"`
	KeyPrefix   string            `json:"keyPrefix" doc:"Prefix of the API key for identification"`
	UserID      *string           `json:"userId,omitempty" doc:"ID of the user who owns the API key"`
	IsStatic    bool              `json:"isStatic" doc:"Whether the API key is environment-managed and protected from deletion"`
	IsBootstrap bool              `` /* 126-byte string literal not displayed */
	ExpiresAt   *time.Time        `json:"expiresAt,omitempty" doc:"Expiration date of the API key"`
	LastUsedAt  *time.Time        `json:"lastUsedAt,omitempty" doc:"Last time the API key was used"`
	CreatedAt   time.Time         `json:"createdAt" doc:"Creation timestamp"`
	UpdatedAt   *time.Time        `json:"updatedAt,omitempty" doc:"Last update timestamp"`
	Permissions []PermissionGrant `json:"permissions" doc:"Permissions held by this key"`
}

ApiKey represents an API key without the secret.

type ApiKeyCreatedDto

type ApiKeyCreatedDto struct {
	ApiKey

	Key string `json:"key" doc:"The full API key secret (only shown once)"`
}

ApiKeyCreatedDto represents a newly created API key with the full secret.

type CreateApiKey

type CreateApiKey struct {
	Name        string            `json:"name" minLength:"1" maxLength:"255" doc:"Name of the API key" example:"My API Key"`
	Description *string           `json:"description,omitempty" maxLength:"1000" doc:"Optional description of the API key"`
	ExpiresAt   *time.Time        `json:"expiresAt,omitempty" doc:"Optional expiration date for the API key"`
	Permissions []PermissionGrant `json:"permissions" minItems:"1" doc:"Permissions granted to this key. Cannot exceed the creator's own permissions."`
}

CreateApiKey represents the request body for creating an API key.

type PermissionGrant

type PermissionGrant struct {
	Permission    string  `json:"permission" minLength:"1" doc:"Permission string" example:"containers:list"`
	EnvironmentID *string `json:"environmentId,omitempty" doc:"Environment ID to scope the grant to; omit for a global grant"`
}

PermissionGrant is one permission granted to an API key, optionally scoped to a single environment. Omit EnvironmentID for a global grant.

type UpdateApiKey

type UpdateApiKey struct {
	Name        *string           `json:"name,omitempty" maxLength:"255" doc:"New name for the API key"`
	Description *string           `json:"description,omitempty" maxLength:"1000" doc:"New description for the API key"`
	ExpiresAt   *time.Time        `json:"expiresAt,omitempty" doc:"New expiration date for the API key"`
	Permissions []PermissionGrant `` /* 141-byte string literal not displayed */
}

UpdateApiKey represents the request body for updating an API key.

Jump to

Keyboard shortcuts

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