Documentation
¶
Overview ¶
Package secret provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
Package secret provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
Index ¶
- func RegisterHandlers(router gin.IRouter, si ServerInterface)
- func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
- type CreateSecretJSONRequestBody
- type CreateSecretRequest
- type GenerateSecretJSONRequestBody
- type GenerateSecretRequest
- type GeneratedSecret
- type GinServerOptions
- type ListSecretsParams
- type MiddlewareFunc
- type Secret
- type SecretStatus
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreateSecret(c *gin.Context)
- func (siw *ServerInterfaceWrapper) DeleteSecret(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GenerateSecret(c *gin.Context)
- func (siw *ServerInterfaceWrapper) ListSecrets(c *gin.Context)
- func (siw *ServerInterfaceWrapper) RevokeSecret(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router gin.IRouter, si ServerInterface)
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type CreateSecretJSONRequestBody ¶
type CreateSecretJSONRequestBody = CreateSecretRequest
CreateSecretJSONRequestBody defines body for CreateSecret for application/json ContentType.
type CreateSecretRequest ¶
type CreateSecretRequest struct {
// ConnectorType Consumer hint (lre_api, smtp, openai…)
ConnectorType string `json:"connector_type"`
Description *string `json:"description"`
// Name Unique name within the tenant
Name string `json:"name"`
// Value Plaintext; encrypted at rest
Value string `json:"value"`
}
CreateSecretRequest Payload for POST /admin-api/v1/secret/secrets. `value` is stored encrypted (AES-256-GCM); it is never echoed back by any endpoint.
type GenerateSecretJSONRequestBody ¶
type GenerateSecretJSONRequestBody = GenerateSecretRequest
GenerateSecretJSONRequestBody defines body for GenerateSecret for application/json ContentType.
type GenerateSecretRequest ¶
type GenerateSecretRequest struct {
// ConnectorType Consumer hint (lre_api, smtp, openai, webhook-hmac…)
ConnectorType string `json:"connector_type"`
Description *string `json:"description"`
// LengthBytes Number of random bytes to mint before hex-encoding (default 32 → 64 hex chars). Capped at 128.
LengthBytes *int `json:"length_bytes,omitempty"`
// Name Unique name within the tenant
Name string `json:"name"`
}
GenerateSecretRequest Payload for POST /admin-api/v1/secret/secrets/generate. Server mints a strong random value (crypto/rand → hex) and stores it encrypted. The plaintext is returned in the response exactly once — never persisted in plaintext nor retrievable later.
type GeneratedSecret ¶
type GeneratedSecret struct {
Secret struct {
// ConnectorType Type of connector this secret belongs to (e.g. smtp, slack, stripe)
ConnectorType string `json:"connector_type"`
CreatedAt time.Time `json:"created_at"`
CreatedBy *string `json:"created_by"`
// Description Optional human-readable note about this secret
Description *string `json:"description"`
Id openapi_types.UUID `json:"id"`
// Name Human-readable name for this secret, unique per tenant
Name string `json:"name"`
// Status Status of a secret
Status SecretStatus `json:"status"`
TenantId *string `json:"tenant_id"`
UpdatedAt time.Time `json:"updated_at"`
} `json:"secret"`
// Value Plaintext value of the newly-minted secret. Shown once.
Value string `json:"value"`
}
GeneratedSecret One-time response from POST /admin-api/v1/secret/secrets/generate. `value` is the plaintext that the caller must capture now — it is never retrievable from any other endpoint.
type GinServerOptions ¶
type GinServerOptions struct {
BaseURL string
Middlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
GinServerOptions provides options for the Gin server.
type ListSecretsParams ¶
type ListSecretsParams struct {
// Status Filter by status (active, revoked)
Status *SecretStatus `form:"status,omitempty" json:"status,omitempty"`
// ConnectorType Filter by connector type
ConnectorType *string `form:"connector_type,omitempty" json:"connector_type,omitempty"`
// TenantId Filter by tenant ID (SUPER_ADMIN only)
TenantId *string `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
Page *int `form:"page,omitempty" json:"page,omitempty"`
PageSize *int `form:"page_size,omitempty" json:"page_size,omitempty"`
}
ListSecretsParams defines parameters for ListSecrets.
type MiddlewareFunc ¶
type Secret ¶
type Secret struct {
// ConnectorType Type of connector this secret belongs to (e.g. smtp, slack, stripe)
ConnectorType string `json:"connector_type"`
CreatedAt time.Time `json:"created_at"`
CreatedBy *string `json:"created_by"`
// Description Optional human-readable note about this secret
Description *string `json:"description"`
Id openapi_types.UUID `json:"id"`
// Name Human-readable name for this secret, unique per tenant
Name string `json:"name"`
// Status Status of a secret
Status SecretStatus `json:"status"`
TenantId *string `json:"tenant_id"`
UpdatedAt time.Time `json:"updated_at"`
}
Secret defines model for Secret.
type SecretStatus ¶
type SecretStatus string
SecretStatus Status of a secret
const ( Active SecretStatus = "active" Revoked SecretStatus = "revoked" )
Defines values for SecretStatus.
type ServerInterface ¶
type ServerInterface interface {
// (GET /admin-api/v1/secret/secrets)
ListSecrets(c *gin.Context, params ListSecretsParams)
// (POST /admin-api/v1/secret/secrets)
CreateSecret(c *gin.Context)
// (POST /admin-api/v1/secret/secrets/generate)
GenerateSecret(c *gin.Context)
// (DELETE /admin-api/v1/secret/secrets/{id})
DeleteSecret(c *gin.Context, id openapi_types.UUID)
// (POST /admin-api/v1/secret/secrets/{id}/revoke)
RevokeSecret(c *gin.Context, id openapi_types.UUID)
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CreateSecret ¶
func (siw *ServerInterfaceWrapper) CreateSecret(c *gin.Context)
CreateSecret operation middleware
func (*ServerInterfaceWrapper) DeleteSecret ¶
func (siw *ServerInterfaceWrapper) DeleteSecret(c *gin.Context)
DeleteSecret operation middleware
func (*ServerInterfaceWrapper) GenerateSecret ¶
func (siw *ServerInterfaceWrapper) GenerateSecret(c *gin.Context)
GenerateSecret operation middleware
func (*ServerInterfaceWrapper) ListSecrets ¶
func (siw *ServerInterfaceWrapper) ListSecrets(c *gin.Context)
ListSecrets operation middleware
func (*ServerInterfaceWrapper) RevokeSecret ¶
func (siw *ServerInterfaceWrapper) RevokeSecret(c *gin.Context)
RevokeSecret operation middleware