reqres

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyInitialized = ErrorCode("already_initialized")
View Source
var ErrBadInput = ErrorCode("bad_request")
View Source
var ErrLowEntropy = ErrorCode("low_entropy")
View Source
var ErrNotFound = ErrorCode("not_found")
View Source
var ErrServerFault = ErrorCode("server_fault")
View Source
var ErrUnauthorized = ErrorCode("unauthorized")

Functions

This section is empty.

Types

type AdminTokenWriteRequest

type AdminTokenWriteRequest struct {
	Data string `json:"data"`
}

AdminTokenWriteRequest is to persist the admin token in memory. Admin token can be persisted only once. It is used to receive a short-lived session token.

type AdminTokenWriteResponse

type AdminTokenWriteResponse struct {
	Err ErrorCode `json:"err,omitempty"`
}

AdminTokenWriteResponse is to persist the admin token in memory.

type CheckInitStateRequest added in v0.2.0

type CheckInitStateRequest struct {
}

CheckInitStateRequest is to check if the SPIKE Keep is initialized.

type CheckInitStateResponse added in v0.2.0

type CheckInitStateResponse struct {
	State data.InitState `json:"state"`
	Err   ErrorCode      `json:"err,omitempty"`
}

CheckInitStateResponse is to check if the SPIKE Keep is initialized.

type ErrorCode added in v0.2.0

type ErrorCode string

type FallbackResponse added in v0.2.0

type FallbackResponse struct {
	Err ErrorCode `json:"err,omitempty"`
}

FallbackResponse is a generic response for any error.

type InitRequest added in v0.2.0

type InitRequest struct {
}

InitRequest is to initialize SPIKE as a superuser.

type InitResponse added in v0.2.0

type InitResponse struct {
	RecoveryToken string    `json:"token"`
	Err           ErrorCode `json:"err,omitempty"`
}

InitResponse is to initialize SPIKE as a superuser.

type RootKeyCacheRequest

type RootKeyCacheRequest struct {
	RootKey string `json:"rootKey"`
}

RootKeyCacheRequest is to cache the generated root key in SPIKE Keep. If the root key is lost due to a crash, it will be retrieved from SPIKE Keep.

type RootKeyCacheResponse

type RootKeyCacheResponse struct {
	Err ErrorCode `json:"error,omitempty"`
}

RootKeyCacheResponse is to cache the generated root key in SPIKE Keep.

type RootKeyReadRequest

type RootKeyReadRequest struct{}

RootKeyReadRequest is a request to get the root key back from remote cache.

type RootKeyReadResponse

type RootKeyReadResponse struct {
	RootKey string    `json:"rootKey"`
	Err     ErrorCode `json:"err,omitempty"`
}

RootKeyReadResponse is a response to get the root key back from remote cache.

type Secret added in v0.2.0

type Secret struct {
	Data map[string]string `json:"data"`
}

TODO: move as entity.data

type SecretDeleteRequest

type SecretDeleteRequest struct {
	Path     string `json:"path"`
	Versions []int  `json:"versions"` // Empty means latest version
}

SecretDeleteRequest for soft-deleting secret versions

type SecretDeleteResponse

type SecretDeleteResponse struct {
	Metadata SecretResponseMetadata `json:"metadata"`
	Err      ErrorCode              `json:"err,omitempty"`
}

SecretDeleteResponse after soft-delete

type SecretListRequest

type SecretListRequest struct {
}

SecretListRequest for listing secrets

type SecretListResponse

type SecretListResponse struct {
	Keys []string  `json:"keys"`
	Err  ErrorCode `json:"err,omitempty"`
}

SecretListResponse for listing secrets

type SecretPutRequest

type SecretPutRequest struct {
	Path   string            `json:"path"`
	Values map[string]string `json:"values"`
	Err    ErrorCode         `json:"err,omitempty"`
}

SecretPutRequest for creating/updating secrets

type SecretPutResponse

type SecretPutResponse struct {
	SecretResponseMetadata
	Err ErrorCode `json:"err,omitempty"`
}

SecretPutResponse is after successful secret write

type SecretReadRequest

type SecretReadRequest struct {
	Path    string `json:"path"`
	Version int    `json:"version,omitempty"` // Optional specific version
}

SecretReadRequest is for getting secrets

type SecretReadResponse

type SecretReadResponse struct {
	Secret
	Data map[string]string `json:"data"`
	Err  ErrorCode         `json:"err,omitempty"`
}

SecretReadResponse is for getting secrets

type SecretResponseMetadata

type SecretResponseMetadata struct {
	CreatedTime time.Time  `json:"created_time"`
	Version     int        `json:"version"`
	DeletedTime *time.Time `json:"deleted_time,omitempty"`
}

SecretResponseMetadata is meta information about secrets for internal tracking.

type SecretUndeleteRequest

type SecretUndeleteRequest struct {
	Path     string `json:"path"`
	Versions []int  `json:"versions"`
}

SecretUndeleteRequest for recovering soft-deleted versions

type SecretUndeleteResponse

type SecretUndeleteResponse struct {
	Metadata SecretResponseMetadata `json:"metadata"`
	Err      ErrorCode              `json:"err,omitempty"`
}

SecretUndeleteResponse after recovery

Jump to

Keyboard shortcuts

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