secret

package
v0.0.0-...-5004fd2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package secret provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.

Index

Constants

View Source
const (
	BearerAuthScopes = "BearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func GetKeyStoreName

func GetKeyStoreName(nsKind base.NamespaceKind, nsID base.ID, policyID base.ID) string

func NewServer

func NewServer(apiServer api.APIServer) *server

func QueryLatestSecretIDIssuedByPolicy

func QueryLatestSecretIDIssuedByPolicy(c ctx.RequestContext, policyFullIdentifier base.DocLocator, limit uint) ([]base.ID, error)

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type GetSecretParams

type GetSecretParams struct {
	WithValue *bool `form:"withValue,omitempty" json:"withValue,omitempty"`
}

GetSecretParams defines parameters for GetSecret.

type ListSecretsParams

type ListSecretsParams struct {
	// PolicyId Policy ID
	PolicyId *string `form:"policyId,omitempty" json:"policyId,omitempty"`
}

ListSecretsParams defines parameters for ListSecrets.

type PutSecretPolicyJSONRequestBody

type PutSecretPolicyJSONRequestBody = SecretPolicyParameters

PutSecretPolicyJSONRequestBody defines body for PutSecretPolicy for application/json ContentType.

type Secret

type Secret = secretComposed

Secret defines model for Secret.

type SecretDoc

type SecretDoc struct {
	base.BaseDoc

	Policy        base.DocLocator     `json:"policy"`
	Created       base.NumericDate    `json:"iat"`
	NotBefore     *base.NumericDate   `json:"nbf,omitempty"`
	NotAfter      *base.NumericDate   `json:"exp,omitempty"`
	KeyVaultStore SecretKeyVaultStore `json:"keyVaultStore"`
}

func (*SecretDoc) PopulateModel

func (d *SecretDoc) PopulateModel(r *Secret)

PopulateModel implements base.ModelPopulater.

func (*SecretDoc) PopulateModelRef

func (d *SecretDoc) PopulateModelRef(r *SecretRef)

type SecretFields

type SecretFields struct {
	ContentType string `json:"contentType,omitempty"`
	Sid         string `json:"sid,omitempty"`
	Value       string `json:"value,omitempty"`
}

SecretFields defines model for SecretFields.

type SecretGenerateMode

type SecretGenerateMode string

SecretGenerateMode defines model for SecretGenerateMode.

const (
	SecretGenerateModeManual                SecretGenerateMode = "manual"
	SecretGenerateModeServerGeneratedRandom SecretGenerateMode = "random-server"
)

Defines values for SecretGenerateMode.

type SecretKeyVaultStore

type SecretKeyVaultStore struct {
	Name string `json:"name"`
	ID   string `json:"id"`
}

type SecretPolicy

type SecretPolicy = secretPolicyComposed

SecretPolicy defines model for SecretPolicy.

type SecretPolicyDoc

type SecretPolicyDoc struct {
	base.BaseDoc

	DisplayName          string                      `json:"displayName"`
	Mode                 SecretGenerateMode          `json:"mode"`
	ExpiryTime           *base.Period                `json:"expiryTime,omitempty"`
	RandomCharacterClass *SecretRandomCharacterClass `json:"randomCharacterClass,omitempty"`
	RandomLength         *int                        `json:"randomLength,omitempty"`
}

func (*SecretPolicyDoc) GetID

func (d *SecretPolicyDoc) GetID() base.ID

func (*SecretPolicyDoc) PopulateModel

func (d *SecretPolicyDoc) PopulateModel(r *SecretPolicy)

func (*SecretPolicyDoc) PopulateModelRef

func (d *SecretPolicyDoc) PopulateModelRef(r *SecretPolicyRef)

type SecretPolicyFields

type SecretPolicyFields struct {
	ExpiryTime           *externalRef0.Period        `json:"expiryTime,omitempty"`
	Mode                 SecretGenerateMode          `json:"mode"`
	RandomCharacterClass *SecretRandomCharacterClass `json:"randomCharacterClass,omitempty"`

	// RandomLength Length of encoded random secret, in bytes
	RandomLength *int `json:"randomLength,omitempty"`
}

SecretPolicyFields defines model for SecretPolicyFields.

type SecretPolicyParameters

type SecretPolicyParameters struct {
	DisplayName          string                      `json:"displayName,omitempty"`
	ExpiryTime           *externalRef0.Period        `json:"expiryTime,omitempty"`
	Mode                 SecretGenerateMode          `json:"mode"`
	RandomCharacterClass *SecretRandomCharacterClass `json:"randomCharacterClass,omitempty"`
	RandomLength         *int                        `json:"randomLength,omitempty"`
}

SecretPolicyParameters defines model for SecretPolicyParameters.

type SecretPolicyRef

type SecretPolicyRef = secretPolicyRefComposed

SecretPolicyRef defines model for SecretPolicyRef.

type SecretPolicyRefFields

type SecretPolicyRefFields struct {
	DisplayName string `json:"displayName"`
}

SecretPolicyRefFields defines model for SecretPolicyRefFields.

type SecretPolicyResponse

type SecretPolicyResponse = SecretPolicy

SecretPolicyResponse defines model for SecretPolicyResponse.

type SecretRandomCharacterClass

type SecretRandomCharacterClass string

SecretRandomCharacterClass defines model for SecretRandomCharacterClass.

const (
	SecretRandomCharClassBase64RawURL SecretRandomCharacterClass = "base64-raw-url"
)

Defines values for SecretRandomCharacterClass.

type SecretRef

type SecretRef = secretRefComposed

SecretRef defines model for SecretRef.

type SecretRefFields

type SecretRefFields struct {
	Exp *externalRef0.NumericDate `json:"exp,omitempty"`
	Iat externalRef0.NumericDate  `json:"iat"`
}

SecretRefFields defines model for SecretRefFields.

type ServerInterface

type ServerInterface interface {
	// List secret policies
	// (GET /v1/{namespaceKind}/{namespaceId}/secret-policies)
	ListSecretPolicies(ctx echo.Context, namespaceKind externalRef0.NamespaceKindParameter, namespaceId externalRef0.NamespaceIdParameter) error
	// Get key spec
	// (GET /v1/{namespaceKind}/{namespaceId}/secret-policies/{resourceId})
	GetSecretPolicy(ctx echo.Context, namespaceKind externalRef0.NamespaceKindParameter, namespaceId externalRef0.NamespaceIdParameter, resourceId externalRef0.ResourceIdParameter) error
	// Put key spec
	// (PUT /v1/{namespaceKind}/{namespaceId}/secret-policies/{resourceId})
	PutSecretPolicy(ctx echo.Context, namespaceKind externalRef0.NamespaceKindParameter, namespaceId externalRef0.NamespaceIdParameter, resourceId externalRef0.ResourceIdParameter) error
	// Generate secret
	// (POST /v1/{namespaceKind}/{namespaceId}/secret-policies/{resourceId}/generate)
	GenerateSecret(ctx echo.Context, namespaceKind externalRef0.NamespaceKindParameter, namespaceId externalRef0.NamespaceIdParameter, resourceId externalRef0.ResourceIdParameter) error
	// List secrets
	// (GET /v1/{namespaceKind}/{namespaceId}/secrets)
	ListSecrets(ctx echo.Context, namespaceKind externalRef0.NamespaceKindParameter, namespaceId externalRef0.NamespaceIdParameter, params ListSecretsParams) error
	// GetSecret
	// (GET /v1/{namespaceKind}/{namespaceId}/secrets/{resourceId})
	GetSecret(ctx echo.Context, namespaceKind externalRef0.NamespaceKindParameter, namespaceId externalRef0.NamespaceIdParameter, resourceId externalRef0.ResourceIdParameter, params GetSecretParams) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) GenerateSecret

func (w *ServerInterfaceWrapper) GenerateSecret(ctx echo.Context) error

GenerateSecret converts echo context to params.

func (*ServerInterfaceWrapper) GetSecret

func (w *ServerInterfaceWrapper) GetSecret(ctx echo.Context) error

GetSecret converts echo context to params.

func (*ServerInterfaceWrapper) GetSecretPolicy

func (w *ServerInterfaceWrapper) GetSecretPolicy(ctx echo.Context) error

GetSecretPolicy converts echo context to params.

func (*ServerInterfaceWrapper) ListSecretPolicies

func (w *ServerInterfaceWrapper) ListSecretPolicies(ctx echo.Context) error

ListSecretPolicies converts echo context to params.

func (*ServerInterfaceWrapper) ListSecrets

func (w *ServerInterfaceWrapper) ListSecrets(ctx echo.Context) error

ListSecrets converts echo context to params.

func (*ServerInterfaceWrapper) PutSecretPolicy

func (w *ServerInterfaceWrapper) PutSecretPolicy(ctx echo.Context) error

PutSecretPolicy converts echo context to params.

Jump to

Keyboard shortcuts

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