Documentation
¶
Index ¶
- Constants
- Variables
- func MakeForbidden(err error) *goa.ServiceError
- func MakeInternalError(err error) *goa.ServiceError
- func MakeInvalidParameters(err error) *goa.ServiceError
- func MakeSecretNotFound(err error) *goa.ServiceError
- func MakeUnauthorized(err error) *goa.ServiceError
- func NewCreateSecretEndpoint(s Service) goa.Endpoint
- func NewGetSecretEndpoint(s Service) goa.Endpoint
- func NewGetSecretValueEndpoint(s Service) goa.Endpoint
- func NewListSecretsEndpoint(s Service) goa.Endpoint
- func NewOperatorGetSecretValueEndpoint(s Service) goa.Endpoint
- func NewUpdateSecretEndpoint(s Service) goa.Endpoint
- func WrapCreateSecretEndpoint(endpoint goa.Endpoint, i ServerInterceptors) goa.Endpoint
- func WrapGetSecretEndpoint(endpoint goa.Endpoint, i ServerInterceptors) goa.Endpoint
- func WrapGetSecretValueEndpoint(endpoint goa.Endpoint, i ServerInterceptors) goa.Endpoint
- func WrapListSecretsEndpoint(endpoint goa.Endpoint, i ServerInterceptors) goa.Endpoint
- func WrapUpdateSecretEndpoint(endpoint goa.Endpoint, i ServerInterceptors) goa.Endpoint
- type AuthentifiedInfo
- type Client
- func (c *Client) CreateSecret(ctx context.Context, p *CreateSecretPayload) (err error)
- func (c *Client) GetSecret(ctx context.Context, p *GetSecretPayload) (res *SecretInfo, err error)
- func (c *Client) GetSecretValue(ctx context.Context, p *GetSecretValuePayload) (res *GetSecretValueResult, err error)
- func (c *Client) ListSecrets(ctx context.Context) (res []*SecretInfoSummary, err error)
- func (c *Client) OperatorGetSecretValue(ctx context.Context, p *OperatorGetSecretValuePayload) (res *OperatorGetSecretValueResult, err error)
- func (c *Client) UpdateSecret(ctx context.Context, p *UpdateSecretPayload) (err error)
- type CreateSecretPayload
- type Endpoints
- type GetSecretPayload
- type GetSecretValuePayload
- type GetSecretValueResult
- type OperatorGetSecretValuePayload
- type OperatorGetSecretValueResult
- type Role
- type SecretInfo
- type SecretInfoSummary
- type ServerInterceptors
- type Service
- type UpdateSecretPayload
- type User
Constants ¶
const APIName = "fishykeys"
APIName is the name of the API as defined in the design.
const APIVersion = "1.0"
APIVersion is the version of the API as defined in the design.
const ServiceName = "secrets"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [6]string{"list secrets", "get secret value", "operator get secret value", "get secret", "create secret", "update secret"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func MakeForbidden ¶
func MakeForbidden(err error) *goa.ServiceError
MakeForbidden builds a goa.ServiceError from an error.
func MakeInternalError ¶
func MakeInternalError(err error) *goa.ServiceError
MakeInternalError builds a goa.ServiceError from an error.
func MakeInvalidParameters ¶
func MakeInvalidParameters(err error) *goa.ServiceError
MakeInvalidParameters builds a goa.ServiceError from an error.
func MakeSecretNotFound ¶
func MakeSecretNotFound(err error) *goa.ServiceError
MakeSecretNotFound builds a goa.ServiceError from an error.
func MakeUnauthorized ¶
func MakeUnauthorized(err error) *goa.ServiceError
MakeUnauthorized builds a goa.ServiceError from an error.
func NewCreateSecretEndpoint ¶
NewCreateSecretEndpoint returns an endpoint function that calls the method "create secret" of service "secrets".
func NewGetSecretEndpoint ¶
NewGetSecretEndpoint returns an endpoint function that calls the method "get secret" of service "secrets".
func NewGetSecretValueEndpoint ¶
NewGetSecretValueEndpoint returns an endpoint function that calls the method "get secret value" of service "secrets".
func NewListSecretsEndpoint ¶
NewListSecretsEndpoint returns an endpoint function that calls the method "list secrets" of service "secrets".
func NewOperatorGetSecretValueEndpoint ¶
NewOperatorGetSecretValueEndpoint returns an endpoint function that calls the method "operator get secret value" of service "secrets".
func NewUpdateSecretEndpoint ¶
NewUpdateSecretEndpoint returns an endpoint function that calls the method "update secret" of service "secrets".
func WrapCreateSecretEndpoint ¶
func WrapCreateSecretEndpoint(endpoint goa.Endpoint, i ServerInterceptors) goa.Endpoint
WrapCreateSecretEndpoint wraps the create secret endpoint with the server-side interceptors defined in the design.
func WrapGetSecretEndpoint ¶
func WrapGetSecretEndpoint(endpoint goa.Endpoint, i ServerInterceptors) goa.Endpoint
WrapGetSecretEndpoint wraps the get secret endpoint with the server-side interceptors defined in the design.
func WrapGetSecretValueEndpoint ¶
func WrapGetSecretValueEndpoint(endpoint goa.Endpoint, i ServerInterceptors) goa.Endpoint
WrapGetSecretValueEndpoint wraps the get secret value endpoint with the server-side interceptors defined in the design.
func WrapListSecretsEndpoint ¶
func WrapListSecretsEndpoint(endpoint goa.Endpoint, i ServerInterceptors) goa.Endpoint
WrapListSecretsEndpoint wraps the list secrets endpoint with the server-side interceptors defined in the design.
func WrapUpdateSecretEndpoint ¶
func WrapUpdateSecretEndpoint(endpoint goa.Endpoint, i ServerInterceptors) goa.Endpoint
WrapUpdateSecretEndpoint wraps the update secret endpoint with the server-side interceptors defined in the design.
Types ¶
type AuthentifiedInfo ¶
type AuthentifiedInfo struct {
// contains filtered or unexported fields
}
AuthentifiedInfo provides metadata about the current interception. It includes service name, method name, and access to the endpoint.
func (*AuthentifiedInfo) CallType ¶
func (info *AuthentifiedInfo) CallType() goa.InterceptorCallType
CallType returns the type of call the interceptor is handling.
func (*AuthentifiedInfo) Method ¶
func (info *AuthentifiedInfo) Method() string
Method returns the name of the method handling the request.
func (*AuthentifiedInfo) RawPayload ¶
func (info *AuthentifiedInfo) RawPayload() any
RawPayload returns the raw payload of the request.
func (*AuthentifiedInfo) Service ¶
func (info *AuthentifiedInfo) Service() string
Service returns the name of the service handling the request.
type Client ¶
type Client struct {
ListSecretsEndpoint goa.Endpoint
GetSecretValueEndpoint goa.Endpoint
OperatorGetSecretValueEndpoint goa.Endpoint
GetSecretEndpoint goa.Endpoint
CreateSecretEndpoint goa.Endpoint
UpdateSecretEndpoint goa.Endpoint
}
Client is the "secrets" service client.
func NewClient ¶
func NewClient(listSecrets, getSecretValue, operatorGetSecretValue, getSecret, createSecret, updateSecret goa.Endpoint) *Client
NewClient initializes a "secrets" service client given the endpoints.
func (*Client) CreateSecret ¶
func (c *Client) CreateSecret(ctx context.Context, p *CreateSecretPayload) (err error)
CreateSecret calls the "create secret" endpoint of the "secrets" service. CreateSecret may return the following errors:
- "invalid_parameters" (type *goa.ServiceError): Invalid token path
- "unauthorized" (type *goa.ServiceError): Unauthorized access
- "forbidden" (type *goa.ServiceError): Forbidden access
- "internal_error" (type *goa.ServiceError): Internal server error
- error: internal error
func (*Client) GetSecret ¶
func (c *Client) GetSecret(ctx context.Context, p *GetSecretPayload) (res *SecretInfo, err error)
GetSecret calls the "get secret" endpoint of the "secrets" service. GetSecret may return the following errors:
- "secret_not_found" (type *goa.ServiceError): Secret not found
- "invalid_parameters" (type *goa.ServiceError): Invalid token path
- "unauthorized" (type *goa.ServiceError): Unauthorized access
- "forbidden" (type *goa.ServiceError): Forbidden access
- "internal_error" (type *goa.ServiceError): Internal server error
- error: internal error
func (*Client) GetSecretValue ¶
func (c *Client) GetSecretValue(ctx context.Context, p *GetSecretValuePayload) (res *GetSecretValueResult, err error)
GetSecretValue calls the "get secret value" endpoint of the "secrets" service. GetSecretValue may return the following errors:
- "secret_not_found" (type *goa.ServiceError): Secret not found
- "invalid_parameters" (type *goa.ServiceError): Invalid token path
- "unauthorized" (type *goa.ServiceError): Unauthorized access
- "forbidden" (type *goa.ServiceError): Forbidden access
- "internal_error" (type *goa.ServiceError): Internal server error
- error: internal error
func (*Client) ListSecrets ¶
func (c *Client) ListSecrets(ctx context.Context) (res []*SecretInfoSummary, err error)
ListSecrets calls the "list secrets" endpoint of the "secrets" service. ListSecrets may return the following errors:
- "secret_not_found" (type *goa.ServiceError): Secret not found
- "invalid_parameters" (type *goa.ServiceError): Invalid token path
- "unauthorized" (type *goa.ServiceError): Unauthorized access
- "forbidden" (type *goa.ServiceError): Forbidden access
- "internal_error" (type *goa.ServiceError): Internal server error
- error: internal error
func (*Client) OperatorGetSecretValue ¶
func (c *Client) OperatorGetSecretValue(ctx context.Context, p *OperatorGetSecretValuePayload) (res *OperatorGetSecretValueResult, err error)
OperatorGetSecretValue calls the "operator get secret value" endpoint of the "secrets" service. OperatorGetSecretValue may return the following errors:
- "secret_not_found" (type *goa.ServiceError): Secret not found
- "invalid_parameters" (type *goa.ServiceError): Invalid token path
- "unauthorized" (type *goa.ServiceError): Unauthorized access
- "forbidden" (type *goa.ServiceError): Forbidden access
- "internal_error" (type *goa.ServiceError): Internal server error
- error: internal error
func (*Client) UpdateSecret ¶
func (c *Client) UpdateSecret(ctx context.Context, p *UpdateSecretPayload) (err error)
UpdateSecret calls the "update secret" endpoint of the "secrets" service. UpdateSecret may return the following errors:
- "secret_not_found" (type *goa.ServiceError): Secret not found
- "invalid_parameters" (type *goa.ServiceError): Invalid token path
- "unauthorized" (type *goa.ServiceError): Unauthorized access
- "forbidden" (type *goa.ServiceError): Forbidden access
- "internal_error" (type *goa.ServiceError): Internal server error
- error: internal error
type CreateSecretPayload ¶
type CreateSecretPayload struct {
// Base64 encoded secret's path
Path string
// The secret value
Value string
// Users IDs authorized to access the secret
AuthorizedUsers []int
// Role IDs authorized to access the secret
AuthorizedRoles []int
}
CreateSecretPayload is the payload type of the secrets service create secret method.
type Endpoints ¶
type Endpoints struct {
ListSecrets goa.Endpoint
GetSecretValue goa.Endpoint
OperatorGetSecretValue goa.Endpoint
GetSecret goa.Endpoint
CreateSecret goa.Endpoint
UpdateSecret goa.Endpoint
}
Endpoints wraps the "secrets" service endpoints.
func NewEndpoints ¶
func NewEndpoints(s Service, si ServerInterceptors) *Endpoints
NewEndpoints wraps the methods of the "secrets" service with endpoints.
type GetSecretPayload ¶
type GetSecretPayload struct {
// Base64 encoded secret's path
Path string
}
GetSecretPayload is the payload type of the secrets service get secret method.
type GetSecretValuePayload ¶
type GetSecretValuePayload struct {
// Base64 encoded secret's path
Path string
}
GetSecretValuePayload is the payload type of the secrets service get secret value method.
type GetSecretValueResult ¶
type GetSecretValueResult struct {
// The secret value
Value *string
// The original path of the secret
Path *string
}
GetSecretValueResult is the result type of the secrets service get secret value method.
type OperatorGetSecretValuePayload ¶
type OperatorGetSecretValuePayload struct {
// Base64 encoded secret's path
Path string
}
OperatorGetSecretValuePayload is the payload type of the secrets service operator get secret value method.
type OperatorGetSecretValueResult ¶
type OperatorGetSecretValueResult struct {
// The secret value
Value *string
// The original path of the secret
Path *string
}
OperatorGetSecretValueResult is the result type of the secrets service operator get secret value method.
type SecretInfo ¶
type SecretInfo struct {
// The original path of the secret
Path string
// The owner of the secret
Owner *User
// Members authorized to access the secret
AuthorizedUsers []*User
// Roles authorized to access the secret
AuthorizedRoles []*Role
// Creation timestamp of the secret
CreatedAt string
// Last update timestamp of the secret
UpdatedAt string
}
The secret's information
type SecretInfoSummary ¶
type SecretInfoSummary struct {
// The original path of the secret
Path string
// The owner of the secret
Owner *User
// Creation timestamp of the secret
CreatedAt string
// Last update timestamp of the secret
UpdatedAt string
// Users authorized to access the secret
Users []*User
// Roles authorized to access the secret
Roles []*Role
}
type ServerInterceptors ¶
type ServerInterceptors interface {
// Server-side interceptor that validates JWT token for HTTP services
Authentified(ctx context.Context, info *AuthentifiedInfo, next goa.Endpoint) (any, error)
}
ServerInterceptors defines the interface for all server-side interceptors. Server interceptors execute after the request is decoded and before the payload is sent to the service. The implementation is responsible for calling next to complete the request.
type Service ¶
type Service interface {
// Retrieve all secrets you have access to
ListSecrets(context.Context) (res []*SecretInfoSummary, err error)
// Retrieve a secret value
GetSecretValue(context.Context, *GetSecretValuePayload) (res *GetSecretValueResult, err error)
// Retrieve a secret value using GRPC
OperatorGetSecretValue(context.Context, *OperatorGetSecretValuePayload) (res *OperatorGetSecretValueResult, err error)
// Retrieve a secret's information
GetSecret(context.Context, *GetSecretPayload) (res *SecretInfo, err error)
// Create a secret
CreateSecret(context.Context, *CreateSecretPayload) (err error)
// Update a secret
UpdateSecret(context.Context, *UpdateSecretPayload) (err error)
}
User service manages user accounts and authentication
type UpdateSecretPayload ¶
type UpdateSecretPayload struct {
// Base64 encoded secret's path
Path string
// The secret value
Value string
// Users IDs authorized to access the secret
AuthorizedUsers []int
// Role IDs authorized to access the secret
AuthorizedRoles []int
}
UpdateSecretPayload is the payload type of the secrets service update secret method.