api

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandler

func RegisterHandler(store *db.Store, svc *service.Service, options api.GinServerOptions, router *gin.Engine)

RegisterHandler wires the secret admin endpoints under /admin-api/v1/secret/secrets. `svc` is optional: when nil, the read-only endpoints (list/delete/revoke) still work but CreateSecret returns 503 with a clear "secret service not configured" message. That matches the key-store-absent mode the rest of the stack tolerates for local-dev / tests.

Types

type SecretHandler

type SecretHandler struct {
	// contains filtered or unexported fields
}

func NewSecretHandler

func NewSecretHandler(store *db.Store, svc *service.Service) *SecretHandler

func (*SecretHandler) CreateSecret

func (h *SecretHandler) CreateSecret(c *gin.Context)

CreateSecret implements api.ServerInterface. ADMIN / CUSTOMER_ADMIN / SUPER_ADMIN can create — gate is the union because auth.IsAdmin only matches the literal ADMIN role and we'd lock out SUPER_ADMIN otherwise. Tenant is taken from the caller's context; cross-tenant creation is not supported via this endpoint by design.

func (*SecretHandler) DeleteSecret

func (h *SecretHandler) DeleteSecret(c *gin.Context, id types.UUID)

DeleteSecret implements api.ServerInterface.

func (*SecretHandler) GenerateSecret

func (h *SecretHandler) GenerateSecret(c *gin.Context)

GenerateSecret implements api.ServerInterface. Mints a new secret with a server-side random value. The plaintext is returned in the response exactly once and never recoverable afterwards. Same auth gate as CreateSecret — admins only.

func (*SecretHandler) ListSecrets

func (h *SecretHandler) ListSecrets(c *gin.Context, params api.ListSecretsParams)

ListSecrets implements api.ServerInterface. SUPER_ADMIN sees all tenants; ADMIN sees only their own.

func (*SecretHandler) RevokeSecret

func (h *SecretHandler) RevokeSecret(c *gin.Context, id types.UUID)

RevokeSecret implements api.ServerInterface.

Jump to

Keyboard shortcuts

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