Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: added error handling and another lint rule for logging

=7f2386da7e08
diff --git a/backend-go/.golangci.yml b/backend-go/.golangci.yml
index 777381ae1f..67c885d8e3 100644
--- a/backend-go/.golangci.yml
+++ b/backend-go/.golangci.yml
@@ -26,6 +26,7 @@ linters:
- revive
- unconvert
- unparam
+ - sloglint
- wastedassign
settings:
@@ -62,10 +63,17 @@ linters:
misspell:
locale: US
+ extra-words:
+ - typo: "Statuser"
+ correction: "Statuser"
prealloc:
simple: true
+ sloglint:
+ no-global: "all"
+ attr-only: true
+
exclusions:
generated: strict
paths:
@@ -84,6 +92,19 @@ linters:
- staticcheck
text: "ST1001"
+ # Pre-init code and utilities can use global slog.
+ - path: cmd/
+ linters:
+ - sloglint
+ text: "global logger"
+ - path: internal/config/
+ linters:
+ - sloglint
+ text: "global logger"
+ - path: internal/libs/
+ linters:
+ - sloglint
+
# Test files can be more relaxed.
- path: _test\.go
linters:
@@ -91,6 +112,7 @@ linters:
- unparam
- prealloc
- exhaustruct
+ - sloglint
formatters:
enable:
diff --git a/backend-go/CLAUDE.md b/backend-go/CLAUDE.md
index 260b5754a0..22d347a085 100644
--- a/backend-go/CLAUDE.md
+++ b/backend-go/CLAUDE.md
@@ -12,6 +12,7 @@ All commands run from `backend-go/`:
- `make gen-db` — regenerate go-jet table types from DB (`internal/database/pg/gen/`)
- `make test` — integration tests (testcontainers, `-race`, 300s timeout)
- `make lint` — **must pass before submission**
+- `make lint-fix` — **use to fix auto fixable ones**
Never edit generated code in `gen/` directories — always regenerate.
diff --git a/backend-go/Makefile b/backend-go/Makefile
index b2515e9ece..0e09868dbc 100644
--- a/backend-go/Makefile
+++ b/backend-go/Makefile
@@ -1,5 +1,8 @@
# Run unit tests (no infra required)
lint:
+ golangci-lint run
+
+lint-fix:
go fix ./... && golangci-lint run --fix
test:
diff --git a/backend-go/cmd/infisical/main.go b/backend-go/cmd/infisical/main.go
index f735dd26bc..13b4598c72 100644
--- a/backend-go/cmd/infisical/main.go
+++ b/backend-go/cmd/infisical/main.go
@@ -36,7 +36,7 @@ func main() {
slog.Error(" " + issue)
}
} else {
- slog.Error("failed to load config", "error", err)
+ slog.Error("failed to load config", slog.Any("error", err))
}
os.Exit(1)
}
@@ -45,7 +45,7 @@ func main() {
ctx := context.Background()
db, err := pg.NewPostgresDB(ctx, cfg.DBConnectionURI, cfg.DBRootCert, cfg.DBReadReplicas)
if err != nil {
- logger.Error("failed to initialize database", "error", err)
+ logger.Error("failed to initialize database", slog.Any("error", err))
os.Exit(1)
}
defer errutil.DeferErr(ctx, db.Close, "closing database")
@@ -62,7 +62,7 @@ func main() {
})
if err != nil {
- logger.Error("failed to initialize services", "error", err)
+ logger.Error("failed to initialize services", slog.Any("error", err))
return
}
// Create server.
@@ -85,7 +85,7 @@ func main() {
srv.Listen(ctx, cfg.Addr(), &wg, errc)
// Wait for signal.
- logger.Info("exiting", "reason", <-errc)
+ logger.Info("exiting", slog.Any("reason", <-errc))
// Send cancellation signal to server goroutines.
cancel()
diff --git a/backend-go/internal/config/config.go b/backend-go/internal/config/config.go
index 751625524f..4f3a970308 100644
--- a/backend-go/internal/config/config.go
+++ b/backend-go/internal/config/config.go
@@ -439,7 +439,7 @@ func LoadConfig() (*Config, error) {
if nodeEnv != string(NodeEnvProduction) {
if err := k.Load(file.Provider(".env"), dotenv.Parser()); err != nil {
if !os.IsNotExist(err) {
- slog.Debug("could not load .env file", "error", err)
+ slog.Debug("could not load .env file", slog.Any("error", err))
}
}
}
diff --git a/backend-go/internal/crypto/sign/sign.go b/backend-go/internal/crypto/sign/sign.go
index 1691fe3a29..8372ca23c0 100644
--- a/backend-go/internal/crypto/sign/sign.go
+++ b/backend-go/internal/crypto/sign/sign.go
@@ -14,10 +14,10 @@ import (
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
- "errors"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
+ "errors"
"fmt"
"hash"
"strings"
diff --git a/backend-go/internal/libs/errutil/error.go b/backend-go/internal/libs/errutil/error.go
new file mode 100644
index 0000000000..714a21a4ab
--- /dev/null
+++ b/backend-go/internal/libs/errutil/error.go
@@ -0,0 +1,86 @@
+package errutil
+
+import "fmt"
+
+// Error is the application-level error returned by services.
+// It carries an HTTP-visible name, message, status code, and optional
+// structured details. It implements the error interface.
+type Error struct {
+ // Name is the stable error class name sent in JSON responses (e.g. "NotFound").
+ Name string
+ // Status is the HTTP status code (e.g. 404).
+ Status int
+ // Message is the human-readable message sent to the client (4xx only; 5xx are masked).
+ Message string
+ // Details holds optional structured data (validation errors, policy info, etc.).
+ // Omitted from JSON if nil.
+ Details any
+ // Err is the underlying error, if any. Never exposed to clients.
+ Err error
+}
+
+func (e *Error) Error() string {
+ if e.Err != nil {
+ return e.Message + ": " + e.Err.Error()
+ }
+
+ return e.Message
+}
+
+func (e *Error) Unwrap() error {
+ return e.Err
+}
+
+// WithDetails attaches optional structured data to the error.
+func (e *Error) WithDetails(details any) *Error {
+ e.Details = details
+
+ return e
+}
+
+// WithErr wraps an underlying cause. The cause is logged but never sent to clients.
+func (e *Error) WithErr(err error) *Error {
+ e.Err = err
+
+ return e
+}
+
+// BadRequest creates a 400 error.
+func BadRequest(format string, args ...any) *Error {
+ return &Error{Name: "BadRequest", Status: 400, Message: fmt.Sprintf(format, args...)}
+}
+
+// Unauthorized creates a 401 error.
+func Unauthorized(format string, args ...any) *Error {
+ return &Error{Name: "UnauthorizedError", Status: 401, Message: fmt.Sprintf(format, args...)}
+}
+
+// Forbidden creates a 403 error.
+func Forbidden(format string, args ...any) *Error {
+ return &Error{Name: "ForbiddenError", Status: 403, Message: fmt.Sprintf(format, args...)}
+}
+
+// NotFound creates a 404 error.
+func NotFound(format string, args ...any) *Error {
+ return &Error{Name: "NotFound", Status: 404, Message: fmt.Sprintf(format, args...)}
+}
+
+// RateLimit creates a 429 error.
+func RateLimit(format string, args ...any) *Error {
+ return &Error{Name: "RateLimitExceeded", Status: 429, Message: fmt.Sprintf(format, args...)}
+}
+
+// InternalServer creates a 500 error.
+func InternalServer(format string, args ...any) *Error {
+ return &Error{Name: "InternalServerError", Status: 500, Message: fmt.Sprintf(format, args...)}
+}
+
+// DatabaseErr creates a 500 database error.
+func DatabaseErr(format string, args ...any) *Error {
+ return &Error{Name: "DatabaseError", Status: 500, Message: fmt.Sprintf(format, args...)}
+}
+
+// GatewayTimeout creates a 504 error.
+func GatewayTimeout(format string, args ...any) *Error {
+ return &Error{Name: "GatewayTimeoutError", Status: 504, Message: fmt.Sprintf(format, args...)}
+}
diff --git a/backend-go/internal/libs/errutil/error_test.go b/backend-go/internal/libs/errutil/error_test.go
new file mode 100644
index 0000000000..d9aff92393
--- /dev/null
+++ b/backend-go/internal/libs/errutil/error_test.go
@@ -0,0 +1,275 @@
+package errutil_test
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "io"
+ "log/slog"
+ "net/http"
+ "testing"
+
+ goa "goa.design/goa/v3/pkg"
+
+ "github.com/infisical/api/internal/libs/errutil"
+)
+
+func TestConstructors(t *testing.T) {
+ t.Parallel()
+
+ tests := []struct {
+ name string
+ err *errutil.Error
+ wantName string
+ wantStatus int
+ wantMsg string
+ }{
+ {"BadRequest", errutil.BadRequest("bad %s", "input"), "BadRequest", 400, "bad input"},
+ {"Unauthorized", errutil.Unauthorized("no auth"), "UnauthorizedError", 401, "no auth"},
+ {"Forbidden", errutil.Forbidden("denied"), "ForbiddenError", 403, "denied"},
+ {"NotFound", errutil.NotFound("missing %s", "item"), "NotFound", 404, "missing item"},
+ {"RateLimit", errutil.RateLimit("slow down"), "RateLimitExceeded", 429, "slow down"},
+ {"InternalServer", errutil.InternalServer("broken"), "InternalServerError", 500, "broken"},
+ {"DatabaseErr", errutil.DatabaseErr("query failed"), "DatabaseError", 500, "query failed"},
+ {"GatewayTimeout", errutil.GatewayTimeout("timed out"), "GatewayTimeoutError", 504, "timed out"},
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ t.Parallel()
+
+ if tt.err.Name != tt.wantName {
+ t.Errorf("Name = %q, want %q", tt.err.Name, tt.wantName)
+ }
+ if tt.err.Status != tt.wantStatus {
+ t.Errorf("Status = %d, want %d", tt.err.Status, tt.wantStatus)
+ }
+ if tt.err.Message != tt.wantMsg {
+ t.Errorf("Message = %q, want %q", tt.err.Message, tt.wantMsg)
+ }
+ })
+ }
+}
+
+func TestErrorString(t *testing.T) {
+ t.Parallel()
+
+ t.Run("without cause", func(t *testing.T) {
+ t.Parallel()
+
+ err := errutil.NotFound("not here")
+ if err.Error() != "not here" {
+ t.Errorf("Error() = %q, want %q", err.Error(), "not here")
+ }
+ })
+
+ t.Run("with cause", func(t *testing.T) {
+ t.Parallel()
+
+ cause := fmt.Errorf("pg error")
+ err := errutil.DatabaseErr("query failed").WithErr(cause)
+ want := "query failed: pg error"
+ if err.Error() != want {
+ t.Errorf("Error() = %q, want %q", err.Error(), want)
+ }
+ })
+}
+
+func TestUnwrap(t *testing.T) {
+ t.Parallel()
+
+ cause := fmt.Errorf("root cause")
+ err := errutil.InternalServer("wrapped").WithErr(cause)
+
+ if !errors.Is(err, cause) {
+ t.Error("errors.Is should find the wrapped cause")
+ }
+}
+
+func TestErrorsAs(t *testing.T) {
+ t.Parallel()
+
+ t.Run("direct", func(t *testing.T) {
+ t.Parallel()
+
+ err := errutil.NotFound("missing")
+
+ var target *errutil.Error
+ if !errors.As(err, &target) {
+ t.Fatal("errors.As should match *errutil.Error")
+ }
+ if target.Name != "NotFound" {
+ t.Errorf("Name = %q, want %q", target.Name, "NotFound")
+ }
+ })
+
+ t.Run("through fmt.Errorf wrap", func(t *testing.T) {
+ t.Parallel()
+
+ inner := errutil.BadRequest("bad input")
+ wrapped := fmt.Errorf("service layer: %w", inner)
+
+ var target *errutil.Error
+ if !errors.As(wrapped, &target) {
+ t.Fatal("errors.As should find *errutil.Error through fmt.Errorf wrapping")
+ }
+ if target.Status != 400 {
+ t.Errorf("Status = %d, want 400", target.Status)
+ }
+ })
+
+ t.Run("outermost wins over inner", func(t *testing.T) {
+ t.Parallel()
+
+ inner := errutil.DatabaseErr("constraint violation")
+ outer := errutil.BadRequest("slug already exists").WithErr(inner)
+
+ var target *errutil.Error
+ if !errors.As(outer, &target) {
+ t.Fatal("errors.As should match")
+ }
+ // errors.As finds the outermost *errutil.Error first
+ if target.Status != 400 {
+ t.Errorf("Status = %d, want 400 (outermost)", target.Status)
+ }
+ })
+}
+
+func TestWithDetails(t *testing.T) {
+ t.Parallel()
+
+ details := map[string]string{"field": "name"}
+ err := errutil.BadRequest("invalid").WithDetails(details)
+
+ if err.Details == nil {
+ t.Fatal("Details should not be nil")
+ }
+
+ m, ok := err.Details.(map[string]string)
+ if !ok {
+ t.Fatal("Details should be map[string]string")
+ }
+ if m["field"] != "name" {
+ t.Errorf("Details[field] = %q, want %q", m["field"], "name")
+ }
+}
+
+func TestFormatter(t *testing.T) {
+ t.Parallel()
+
+ logger := slog.New(slog.NewTextHandler(io.Discard, nil))
+ formatter := errutil.NewFormatter(logger)
+ ctx := context.Background()
+
+ t.Run("4xx errutil.Error sends message to client", func(t *testing.T) {
+ t.Parallel()
+
+ resp := formatter(ctx, errutil.NotFound("project %s not found", "abc"))
+
+ body, ok := resp.(*errutil.ErrorBody)
+ if !ok {
+ t.Fatal("expected *errutil.ErrorBody")
+ }
+ if body.Code != http.StatusNotFound {
+ t.Errorf("Code = %d, want %d", body.Code, http.StatusNotFound)
+ }
+ if body.Message != "project abc not found" {
+ t.Errorf("Message = %q, want %q", body.Message, "project abc not found")
+ }
+ if body.Err != "NotFound" {
+ t.Errorf("Err = %q, want %q", body.Err, "NotFound")
+ }
+ if body.StatusCode() != http.StatusNotFound {
+ t.Errorf("StatusCode() = %d, want %d", body.StatusCode(), http.StatusNotFound)
+ }
+ })
+
+ t.Run("4xx errutil.Error includes details", func(t *testing.T) {
+ t.Parallel()
+
+ details := map[string]string{"slug": "taken"}
+ resp := formatter(ctx, errutil.BadRequest("slug exists").WithDetails(details))
+
+ body, ok := resp.(*errutil.ErrorBody)
+ if !ok {
+ t.Fatal("expected *errutil.ErrorBody")
+ }
+ if body.Details == nil {
+ t.Fatal("Details should not be nil for 4xx")
+ }
+ })
+
+ t.Run("5xx errutil.Error masks message", func(t *testing.T) {
+ t.Parallel()
+
+ resp := formatter(ctx, errutil.DatabaseErr("pg: unique constraint on users_email_key"))
+
+ body, ok := resp.(*errutil.ErrorBody)
+ if !ok {
+ t.Fatal("expected *errutil.ErrorBody")
+ }
+ if body.Code != http.StatusInternalServerError {
+ t.Errorf("Code = %d, want %d", body.Code, http.StatusInternalServerError)
+ }
+ if body.Message != "Something went wrong" {
+ t.Errorf("Message = %q, want %q", body.Message, "Something went wrong")
+ }
+ if body.Err != "DatabaseError" {
+ t.Errorf("Err = %q, want %q", body.Err, "DatabaseError")
+ }
+ })
+
+ t.Run("goa.ServiceError maps to status", func(t *testing.T) {
+ t.Parallel()
+
+ goaErr := goa.MissingFieldError("name", "payload")
+ resp := formatter(ctx, goaErr)
+
+ body, ok := resp.(*errutil.ErrorBody)
+ if !ok {
+ t.Fatal("expected *errutil.ErrorBody")
+ }
+ if body.Code != http.StatusBadRequest {
+ t.Errorf("Code = %d, want %d", body.Code, http.StatusBadRequest)
+ }
+ })
+
+ t.Run("unknown error returns safe 500", func(t *testing.T) {
+ t.Parallel()
+
+ resp := formatter(ctx, fmt.Errorf("something unexpected"))
+
+ body, ok := resp.(*errutil.ErrorBody)
+ if !ok {
+ t.Fatal("expected *errutil.ErrorBody")
+ }
+ if body.Code != http.StatusInternalServerError {
+ t.Errorf("Code = %d, want %d", body.Code, http.StatusInternalServerError)
+ }
+ if body.Message != "Something went wrong" {
+ t.Errorf("Message = %q, want %q", body.Message, "Something went wrong")
+ }
+ if body.Err != "InternalServerError" {
+ t.Errorf("Err = %q, want %q", body.Err, "InternalServerError")
+ }
+ })
+
+ t.Run("wrapped errutil.Error is found through fmt.Errorf", func(t *testing.T) {
+ t.Parallel()
+
+ inner := errutil.Forbidden("no access")
+ wrapped := fmt.Errorf("permission check: %w", inner)
+ resp := formatter(ctx, wrapped)
+
+ body, ok := resp.(*errutil.ErrorBody)
+ if !ok {
+ t.Fatal("expected *errutil.ErrorBody")
+ }
+ if body.Code != http.StatusForbidden {
+ t.Errorf("Code = %d, want %d", body.Code, http.StatusForbidden)
+ }
+ if body.Message != "no access" {
+ t.Errorf("Message = %q, want %q", body.Message, "no access")
+ }
+ })
+}
diff --git a/backend-go/internal/libs/errutil/formatter.go b/backend-go/internal/libs/errutil/formatter.go
new file mode 100644
index 0000000000..3349d6e042
--- /dev/null
+++ b/backend-go/internal/libs/errutil/formatter.go
@@ -0,0 +1,107 @@
+package errutil
+
+import (
+ "context"
+ "errors"
+ "log/slog"
+ "net/http"
+
+ goahttp "goa.design/goa/v3/http"
+ goa "goa.design/goa/v3/pkg"
+)
+
+// ErrorBody is the JSON response shape sent to clients on error.
+// It matches the Node.js backend format for API compatibility.
+type ErrorBody struct {
+ Code int `json:"statusCode"`
+ Message string `json:"message"`
+ Err string `json:"error"`
+ Details any `json:"details,omitempty"`
+ ReqID string `json:"reqId,omitempty"`
+}
+
+// StatusCode implements goahttp.Statuser so Goa writes the correct HTTP status.
+func (b *ErrorBody) StatusCode() int {
+ return b.Code
+}
+
+// NewFormatter returns a Goa-compatible error formatter that maps errutil.Error
+// and goa.ServiceError to the standard JSON response shape.
+//
+// Three error categories are handled:
+// 1. *errutil.Error (service errors) — 4xx logged at WARN with message sent to client;
+// 5xx logged at ERROR with message masked as "Something went wrong".
+// 2. *goa.ServiceError (Goa validation/decode errors) — logged at WARN, mapped to status.
+// 3. Any other error (unknown) — logged at ERROR, returns 500 with safe message.
+func NewFormatter(logger *slog.Logger) func(ctx context.Context, err error) goahttp.Statuser {
+ return func(ctx context.Context, err error) goahttp.Statuser {
+ var apiErr *Error
+ if errors.As(err, &apiErr) {
+ if apiErr.Status >= http.StatusInternalServerError {
+ logger.ErrorContext(ctx, "server error",
+ slog.String("name", apiErr.Name),
+ slog.Int("status", apiErr.Status),
+ slog.String("message", apiErr.Message),
+ slog.Any("cause", apiErr.Err),
+ )
+
+ return &ErrorBody{
+ Code: apiErr.Status,
+ Message: "Something went wrong",
+ Err: apiErr.Name,
+ }
+ }
+
+ logger.WarnContext(ctx, "api error",
+ slog.String("name", apiErr.Name),
+ slog.Int("status", apiErr.Status),
+ slog.String("message", apiErr.Message),
+ slog.Any("cause", apiErr.Err),
+ )
+
+ return &ErrorBody{
+ Code: apiErr.Status,
+ Message: apiErr.Message,
+ Err: apiErr.Name,
+ Details: apiErr.Details,
+ }
+ }
+
+ var goaErr *goa.ServiceError
+ if errors.As(err, &goaErr) {
+ status := mapGoaErrorStatus(goaErr)
+ logger.WarnContext(ctx, "goa validation error",
+ slog.String("name", goaErr.Name),
+ slog.Int("status", status),
+ slog.String("message", goaErr.Message),
+ )
+
+ return &ErrorBody{
+ Code: status,
+ Message: goaErr.Message,
+ Err: goaErr.Name,
+ }
+ }
+
+ logger.ErrorContext(ctx, "unhandled server error", slog.Any("error", err))
+
+ return &ErrorBody{
+ Code: http.StatusInternalServerError,
+ Message: "Something went wrong",
+ Err: "InternalServerError",
+ }
+ }
+}
+
+// mapGoaErrorStatus maps Goa's ServiceError to HTTP status codes.
+func mapGoaErrorStatus(err *goa.ServiceError) int {
+ if err.Fault {
+ return http.StatusInternalServerError
+ }
+
+ if err.Timeout {
+ return http.StatusGatewayTimeout
+ }
+
+ return http.StatusBadRequest
+}
diff --git a/backend-go/internal/server/design/common/errors.go b/backend-go/internal/server/design/common/errors.go
new file mode 100644
index 0000000000..0c1461e27c
--- /dev/null
+++ b/backend-go/internal/server/design/common/errors.go
@@ -0,0 +1,27 @@
+package common
+
+import (
+ . "goa.design/goa/v3/dsl"
+)
+
+// APIErrorResult is the standard error response shape for all API endpoints.
+// It matches the Node.js backend format for API compatibility.
+var APIErrorResult = Type("APIErrorResult", func() {
+ Attribute("statusCode", Int, "HTTP status code")
+ Attribute("message", String, "Human-readable error message")
+ Attribute("error", String, "Error class name", func() {
+ Meta("struct:field:name", "ErrorClass")
+ })
+ Attribute("details", Any, "Optional structured details")
+ Required("statusCode", "message", "error")
+})
+
+// CommonServiceErrors adds the standard API error references to a Service DSL.
+// Call this inside every Service() block so all methods inherit error responses.
+func CommonServiceErrors() {
+ Error("bad_request", APIErrorResult)
+ Error("unauthorized", APIErrorResult)
+ Error("forbidden", APIErrorResult)
+ Error("not_found", APIErrorResult)
+ Error("internal_error", APIErrorResult)
+}
diff --git a/backend-go/internal/server/design/design.go b/backend-go/internal/server/design/design.go
index abc3a37be1..752c6d39e2 100644
--- a/backend-go/internal/server/design/design.go
+++ b/backend-go/internal/server/design/design.go
@@ -3,6 +3,7 @@ package design
import (
. "goa.design/goa/v3/dsl"
+ "github.com/infisical/api/internal/server/design/common"
// Blank-import product line designs to register their DSL.
_ "github.com/infisical/api/internal/server/design/platform"
_ "github.com/infisical/api/internal/server/design/secretmanager"
@@ -17,4 +18,20 @@ var _ = API("infisical", func() {
URI("http://localhost:8080")
})
})
+ Meta("openapi:example", "false")
+
+ // Global error declarations — generate OpenAPI error responses for all endpoints.
+ Error("bad_request", common.APIErrorResult, "Invalid request")
+ Error("unauthorized", common.APIErrorResult, "Authentication required")
+ Error("forbidden", common.APIErrorResult, "Permission denied")
+ Error("not_found", common.APIErrorResult, "Resource not found")
+ Error("internal_error", common.APIErrorResult, "Internal server error")
+
+ HTTP(func() {
+ Response("bad_request", StatusBadRequest)
+ Response("unauthorized", StatusUnauthorized)
+ Response("forbidden", StatusForbidden)
+ Response("not_found", StatusNotFound)
+ Response("internal_error", StatusInternalServerError)
+ })
})
diff --git a/backend-go/internal/server/design/platform/projects.go b/backend-go/internal/server/design/platform/projects.go
index 2d072554db..65a9ee5cca 100644
--- a/backend-go/internal/server/design/platform/projects.go
+++ b/backend-go/internal/server/design/platform/projects.go
@@ -2,6 +2,8 @@ package platform
import (
. "goa.design/goa/v3/dsl"
+
+ "github.com/infisical/api/internal/server/design/common"
)
// CreateProjectPayload describes the input for creating a project.
@@ -27,6 +29,8 @@ var ProjectResult = ResultType("application/vnd.project", func() {
var _ = Service("projects", func() {
Description("Service for managing projects.")
+ common.CommonServiceErrors()
+
Method("getHealth", func() {
Description("Health check for the projects service.")
Result(String)
diff --git a/backend-go/internal/server/design/secretmanager/secrets.go b/backend-go/internal/server/design/secretmanager/secrets.go
index 2341cc0677..d73108dbe1 100644
--- a/backend-go/internal/server/design/secretmanager/secrets.go
+++ b/backend-go/internal/server/design/secretmanager/secrets.go
@@ -2,6 +2,8 @@ package secretmanager
import (
. "goa.design/goa/v3/dsl"
+
+ "github.com/infisical/api/internal/server/design/common"
)
// Secret describes the input for creating a secret.
@@ -31,6 +33,8 @@ var SecretResult = ResultType("application/vnd.secret", func() {
var _ = Service("secrets", func() {
Description("Service for managing secrets.")
+ common.CommonServiceErrors()
+
Method("getHealth", func() {
Description("Health check for the secrets service.")
Result(String)
diff --git a/backend-go/internal/server/gen/http/cli/infisical/cli.go b/backend-go/internal/server/gen/http/cli/infisical/cli.go
index cdce7d1d61..d7b2391930 100644
--- a/backend-go/internal/server/gen/http/cli/infisical/cli.go
+++ b/backend-go/internal/server/gen/http/cli/infisical/cli.go
@@ -254,7 +254,7 @@ func projectsCreateProjectUsage() {
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Example:")
- fmt.Fprintf(os.Stderr, " %s %s\n", os.Args[0], "projects create-project --body '{\n \"name\": \"hay\",\n \"orgId\": \"Id eveniet atque sed.\"\n }'")
+ fmt.Fprintf(os.Stderr, " %s %s\n", os.Args[0], "projects create-project --body '{\n \"name\": \"a9\",\n \"orgId\": \"Eius dolorum eius qui repellendus aperiam vel.\"\n }'")
}
// secretsUsage displays the usage of the secrets command and its subcommands.
@@ -303,7 +303,7 @@ func secretsCreateSecretUsage() {
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Example:")
- fmt.Fprintf(os.Stderr, " %s %s\n", os.Args[0], "secrets create-secret --body '{\n \"environment\": \"Qui eum quos eum pariatur.\",\n \"key\": \"DATABASE_URL\",\n \"projectId\": \"Deleniti itaque voluptatum.\",\n \"value\": \"Reiciendis minima.\"\n }'")
+ fmt.Fprintf(os.Stderr, " %s %s\n", os.Args[0], "secrets create-secret --body '{\n \"environment\": \"Omnis et non.\",\n \"key\": \"DATABASE_URL\",\n \"projectId\": \"Sed consequatur.\",\n \"value\": \"Earum sed blanditiis est dolor.\"\n }'")
}
func secretsGetSecretUsage() {
@@ -321,7 +321,7 @@ func secretsGetSecretUsage() {
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Example:")
- fmt.Fprintf(os.Stderr, " %s %s\n", os.Args[0], "secrets get-secret --id \"Expedita molestias consequatur magnam dolores eius.\"")
+ fmt.Fprintf(os.Stderr, " %s %s\n", os.Args[0], "secrets get-secret --id \"Dolor est illo.\"")
}
func secretsUpdateSecretUsage() {
@@ -341,7 +341,7 @@ func secretsUpdateSecretUsage() {
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Example:")
- fmt.Fprintf(os.Stderr, " %s %s\n", os.Args[0], "secrets update-secret --body '{\n \"key\": \"Omnis autem quo ducimus facilis veritatis.\",\n \"value\": \"Eligendi quasi iusto.\"\n }' --id \"Consectetur ducimus est iste ut provident.\"")
+ fmt.Fprintf(os.Stderr, " %s %s\n", os.Args[0], "secrets update-secret --body '{\n \"key\": \"Omnis veniam.\",\n \"value\": \"Explicabo et sed.\"\n }' --id \"Eum est consequatur velit eaque quibusdam id.\"")
}
func secretsDeleteSecretUsage() {
@@ -359,7 +359,7 @@ func secretsDeleteSecretUsage() {
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Example:")
- fmt.Fprintf(os.Stderr, " %s %s\n", os.Args[0], "secrets delete-secret --id \"Eos sed reprehenderit atque.\"")
+ fmt.Fprintf(os.Stderr, " %s %s\n", os.Args[0], "secrets delete-secret --id \"Et velit quod.\"")
}
func secretsListSecretsUsage() {
@@ -379,5 +379,5 @@ func secretsListSecretsUsage() {
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Example:")
- fmt.Fprintf(os.Stderr, " %s %s\n", os.Args[0], "secrets list-secrets --project-id \"Dolorum ut ipsum.\" --environment \"Explicabo voluptas necessitatibus enim hic nam.\"")
+ fmt.Fprintf(os.Stderr, " %s %s\n", os.Args[0], "secrets list-secrets --project-id \"Quia aspernatur necessitatibus blanditiis iure dolor labore.\" --environment \"Est aut aliquam placeat ducimus sit.\"")
}
diff --git a/backend-go/internal/server/gen/http/openapi.json b/backend-go/internal/server/gen/http/openapi.json
index b16557ed25..44bff2ef01 100644
--- a/backend-go/internal/server/gen/http/openapi.json
+++ b/backend-go/internal/server/gen/http/openapi.json
@@ -1 +1 @@
-{"swagger":"2.0","info":{"title":"Infisical API","description":"Infisical secret management platform API","version":"0.0.1"},"host":"localhost:8080","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/api/v1/platform/projects":{"post":{"tags":["projects"],"summary":"createProject projects","description":"Create a new project.","operationId":"projects#createProject","parameters":[{"name":"CreateProjectRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/CreateProjectPayload","required":["name","orgId"]}}],"responses":{"201":{"description":"Created response.","schema":{"$ref":"#/definitions/Project"}}},"schemes":["http"]}},"/api/v1/platform/projects/health":{"get":{"tags":["projects"],"summary":"getHealth projects","description":"Health check for the projects service.","operationId":"projects#getHealth","responses":{"200":{"description":"OK response.","schema":{"type":"string"}}},"schemes":["http"]}},"/api/v1/secret-manager/secrets":{"get":{"tags":["secrets"],"summary":"listSecrets secrets","description":"List secrets for an environment.","operationId":"secrets#listSecrets","parameters":[{"name":"projectId","in":"query","description":"Project ID","required":true,"type":"string"},{"name":"environment","in":"query","description":"Environment slug","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/SecretsSecretResultResponseCollection"}}},"schemes":["http"]},"post":{"tags":["secrets"],"summary":"createSecret secrets","description":"Create a new secret.","operationId":"secrets#createSecret","parameters":[{"name":"CreateSecretRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/Secret","required":["key","value","environment","projectId"]}}],"responses":{"201":{"description":"Created response.","schema":{"$ref":"#/definitions/Secret"}}},"schemes":["http"]}},"/api/v1/secret-manager/secrets/health":{"get":{"tags":["secrets"],"summary":"getHealth secrets","description":"Health check for the secrets service.","operationId":"secrets#getHealth","responses":{"200":{"description":"OK response.","schema":{"type":"string"}}},"schemes":["http"]}},"/api/v1/secret-manager/secrets/{id}":{"get":{"tags":["secrets"],"summary":"getSecret secrets","description":"Get a secret by ID.","operationId":"secrets#getSecret","parameters":[{"name":"id","in":"path","description":"Secret ID","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/Secret"}}},"schemes":["http"]},"delete":{"tags":["secrets"],"summary":"deleteSecret secrets","description":"Delete a secret by ID.","operationId":"secrets#deleteSecret","parameters":[{"name":"id","in":"path","description":"Secret ID","required":true,"type":"string"}],"responses":{"204":{"description":"No Content response."}},"schemes":["http"]},"patch":{"tags":["secrets"],"summary":"updateSecret secrets","description":"Update an existing secret.","operationId":"secrets#updateSecret","parameters":[{"name":"id","in":"path","description":"Secret ID","required":true,"type":"string"},{"name":"UpdateSecretRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/SecretsUpdateSecretRequestBody"}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/Secret"}}},"schemes":["http"]}}},"definitions":{"CreateProjectPayload":{"title":"CreateProjectPayload","type":"object","properties":{"name":{"type":"string","description":"Project name","example":"djc","minLength":1},"orgId":{"type":"string","description":"Organization ID","example":"Sequi nobis aut."}},"example":{"name":"2y8","orgId":"Soluta assumenda eos et voluptatem porro quod."},"required":["name","orgId"]},"Project":{"title":"Mediatype identifier: application/vnd.project; view=default","type":"object","properties":{"id":{"type":"string","description":"Project ID","example":"Quis repellendus eos sed cum."},"name":{"type":"string","description":"Project name","example":"Quibusdam iure officia amet."},"orgId":{"type":"string","description":"Organization ID","example":"Voluptatem consequatur dolorem itaque suscipit sint ratione."}},"description":"CreateProjectResponseBody result type (default view)","example":{"id":"Non enim suscipit consequatur.","name":"Illum architecto aliquid.","orgId":"Debitis vitae."},"required":["id","name","orgId"]},"Secret":{"title":"Mediatype identifier: application/vnd.secret; view=default","type":"object","properties":{"environment":{"type":"string","description":"Environment slug","example":"Eum adipisci sunt quis praesentium alias."},"id":{"type":"string","description":"Secret ID","example":"Praesentium et sapiente totam unde officiis necessitatibus."},"key":{"type":"string","description":"Secret key","example":"Sit aut."},"projectId":{"type":"string","description":"Project ID","example":"Odit et vel voluptas aut."},"value":{"type":"string","description":"Secret value","example":"Et rerum eaque rem facilis sit."}},"description":"CreateSecretResponseBody result type (default view)","example":{"environment":"Facilis beatae soluta omnis.","id":"Perspiciatis excepturi error rerum adipisci quos.","key":"Dolorem optio blanditiis autem cum totam sint.","projectId":"Sed blanditiis.","value":"Accusantium sit dolorum dolor."},"required":["id","key","value","environment","projectId"]},"SecretResultResponse":{"title":"Mediatype identifier: application/vnd.secret; view=default","type":"object","properties":{"environment":{"type":"string","description":"Environment slug","example":"Aut optio consectetur temporibus."},"id":{"type":"string","description":"Secret ID","example":"Maxime est quo iure."},"key":{"type":"string","description":"Secret key","example":"Nisi iusto voluptas non aliquam ipsam consequatur."},"projectId":{"type":"string","description":"Project ID","example":"Dolor fugiat maxime nisi quas expedita."},"value":{"type":"string","description":"Secret value","example":"Suscipit enim."}},"description":"SecretResultResponse result type (default view)","example":{"environment":"Nulla et.","id":"Ducimus qui.","key":"Ut aut.","projectId":"Sint neque placeat suscipit delectus ea eligendi.","value":"Qui quasi ducimus vel."},"required":["id","key","value","environment","projectId"]},"SecretsSecretResultResponseCollection":{"title":"Mediatype identifier: application/vnd.secret; type=collection; view=default","type":"array","items":{"$ref":"#/definitions/SecretResultResponse"},"description":"ListSecretsResponseBody is the result type for an array of SecretResultResponse (default view)","example":[{"environment":"Non quaerat laudantium.","id":"Dolorem libero deleniti molestiae nisi in sunt.","key":"Voluptas quo et ratione.","projectId":"Ea voluptatem ut eius dolorum eius qui.","value":"Qui consequuntur ut sed harum dolore ratione."},{"environment":"Non quaerat laudantium.","id":"Dolorem libero deleniti molestiae nisi in sunt.","key":"Voluptas quo et ratione.","projectId":"Ea voluptatem ut eius dolorum eius qui.","value":"Qui consequuntur ut sed harum dolore ratione."},{"environment":"Non quaerat laudantium.","id":"Dolorem libero deleniti molestiae nisi in sunt.","key":"Voluptas quo et ratione.","projectId":"Ea voluptatem ut eius dolorum eius qui.","value":"Qui consequuntur ut sed harum dolore ratione."}]},"SecretsUpdateSecretRequestBody":{"title":"SecretsUpdateSecretRequestBody","type":"object","properties":{"key":{"type":"string","description":"Secret key","example":"Dolor modi omnis et non ipsam."},"value":{"type":"string","description":"Secret value","example":"Consequatur est sequi id quidem necessitatibus velit."}},"example":{"key":"Ut repellat et nihil alias veritatis maiores.","value":"Aliquam impedit sint animi at quia voluptas."}}}}
\ No newline at end of file
+{"swagger":"2.0","info":{"title":"Infisical API","description":"Infisical secret management platform API","version":"0.0.1"},"host":"localhost:8080","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/api/v1/platform/projects":{"post":{"tags":["projects"],"summary":"createProject projects","description":"Create a new project.","operationId":"projects#createProject","parameters":[{"name":"CreateProjectRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/CreateProjectPayload","required":["name","orgId"]}}],"responses":{"201":{"description":"Created response.","schema":{"$ref":"#/definitions/Project"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}}},"schemes":["http"]}},"/api/v1/platform/projects/health":{"get":{"tags":["projects"],"summary":"getHealth projects","description":"Health check for the projects service.","operationId":"projects#getHealth","responses":{"200":{"description":"OK response.","schema":{"type":"string"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}}},"schemes":["http"]}},"/api/v1/secret-manager/secrets":{"get":{"tags":["secrets"],"summary":"listSecrets secrets","description":"List secrets for an environment.","operationId":"secrets#listSecrets","parameters":[{"name":"projectId","in":"query","description":"Project ID","required":true,"type":"string"},{"name":"environment","in":"query","description":"Environment slug","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/SecretsSecretResultResponseCollection"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}}},"schemes":["http"]},"post":{"tags":["secrets"],"summary":"createSecret secrets","description":"Create a new secret.","operationId":"secrets#createSecret","parameters":[{"name":"CreateSecretRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/Secret","required":["key","value","environment","projectId"]}}],"responses":{"201":{"description":"Created response.","schema":{"$ref":"#/definitions/Secret"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}}},"schemes":["http"]}},"/api/v1/secret-manager/secrets/health":{"get":{"tags":["secrets"],"summary":"getHealth secrets","description":"Health check for the secrets service.","operationId":"secrets#getHealth","responses":{"200":{"description":"OK response.","schema":{"type":"string"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}}},"schemes":["http"]}},"/api/v1/secret-manager/secrets/{id}":{"get":{"tags":["secrets"],"summary":"getSecret secrets","description":"Get a secret by ID.","operationId":"secrets#getSecret","parameters":[{"name":"id","in":"path","description":"Secret ID","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/Secret"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}}},"schemes":["http"]},"delete":{"tags":["secrets"],"summary":"deleteSecret secrets","description":"Delete a secret by ID.","operationId":"secrets#deleteSecret","parameters":[{"name":"id","in":"path","description":"Secret ID","required":true,"type":"string"}],"responses":{"204":{"description":"No Content response."},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}}},"schemes":["http"]},"patch":{"tags":["secrets"],"summary":"updateSecret secrets","description":"Update an existing secret.","operationId":"secrets#updateSecret","parameters":[{"name":"id","in":"path","description":"Secret ID","required":true,"type":"string"},{"name":"UpdateSecretRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/SecretsUpdateSecretRequestBody"}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/Secret"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/APIErrorResult","required":["statusCode","message","error"]}}},"schemes":["http"]}}},"definitions":{"APIErrorResult":{"title":"APIErrorResult","type":"object","properties":{"details":{"description":"Optional structured details","example":"Accusantium error veritatis minus quas."},"error":{"type":"string","description":"Error class name","example":"Cumque non rerum minima."},"message":{"type":"string","description":"Human-readable error message","example":"Dolores et nihil harum."},"statusCode":{"type":"integer","description":"HTTP status code","example":5894983497943371786,"format":"int64"}},"description":"Invalid request","example":{"details":"Reprehenderit autem.","error":"Officiis laudantium vero dolor dignissimos molestiae laboriosam.","message":"Eveniet magni est.","statusCode":967567680778815670},"required":["statusCode","message","error"]},"CreateProjectPayload":{"title":"CreateProjectPayload","type":"object","properties":{"name":{"type":"string","description":"Project name","example":"nj3","minLength":1},"orgId":{"type":"string","description":"Organization ID","example":"Aut esse nostrum."}},"example":{"name":"eq","orgId":"Sunt ut similique quibusdam numquam dolorem cum."},"required":["name","orgId"]},"Project":{"title":"Mediatype identifier: application/vnd.project; view=default","type":"object","properties":{"id":{"type":"string","description":"Project ID","example":"Eius praesentium doloremque."},"name":{"type":"string","description":"Project name","example":"Eum recusandae."},"orgId":{"type":"string","description":"Organization ID","example":"Culpa tempore."}},"description":"CreateProjectResponseBody result type (default view)","example":{"id":"Dolores consequatur saepe.","name":"Ullam iure molestiae.","orgId":"Quam vitae fugiat ut aut."},"required":["id","name","orgId"]},"Secret":{"title":"Mediatype identifier: application/vnd.secret; view=default","type":"object","properties":{"environment":{"type":"string","description":"Environment slug","example":"Delectus sed ex vel architecto."},"id":{"type":"string","description":"Secret ID","example":"Qui facere ipsum dolor."},"key":{"type":"string","description":"Secret key","example":"Et reiciendis eligendi voluptatem incidunt."},"projectId":{"type":"string","description":"Project ID","example":"Voluptas accusamus repellendus."},"value":{"type":"string","description":"Secret value","example":"Earum blanditiis consequatur fugiat qui."}},"description":"CreateSecretResponseBody result type (default view)","example":{"environment":"Et nisi eius cum qui.","id":"Ut ratione id.","key":"Est consectetur culpa debitis consequuntur dicta.","projectId":"In ab nisi.","value":"Ex voluptatem animi ullam illum accusamus eveniet."},"required":["id","key","value","environment","projectId"]},"SecretResultResponse":{"title":"Mediatype identifier: application/vnd.secret; view=default","type":"object","properties":{"environment":{"type":"string","description":"Environment slug","example":"Necessitatibus accusamus dolor voluptatem architecto."},"id":{"type":"string","description":"Secret ID","example":"Expedita molestiae ab dolore repellat ut praesentium."},"key":{"type":"string","description":"Secret key","example":"Omnis suscipit qui inventore."},"projectId":{"type":"string","description":"Project ID","example":"Et aut facilis aut."},"value":{"type":"string","description":"Secret value","example":"Nihil id aut ut autem soluta."}},"description":"SecretResultResponse result type (default view)","example":{"environment":"Aperiam culpa voluptatum.","id":"Consequatur aut deleniti velit.","key":"Rerum sunt quod eaque.","projectId":"Dolorem fuga quia.","value":"Voluptatem sapiente corrupti dignissimos officiis ut."},"required":["id","key","value","environment","projectId"]},"SecretsSecretResultResponseCollection":{"title":"Mediatype identifier: application/vnd.secret; type=collection; view=default","type":"array","items":{"$ref":"#/definitions/SecretResultResponse"},"description":"ListSecretsResponseBody is the result type for an array of SecretResultResponse (default view)","example":[{"environment":"Maxime est quo iure.","id":"Sequi id quidem necessitatibus velit.","key":"Ut repellat et nihil alias veritatis maiores.","projectId":"Nisi iusto voluptas non aliquam ipsam consequatur.","value":"Aliquam impedit sint animi at quia voluptas."},{"environment":"Maxime est quo iure.","id":"Sequi id quidem necessitatibus velit.","key":"Ut repellat et nihil alias veritatis maiores.","projectId":"Nisi iusto voluptas non aliquam ipsam consequatur.","value":"Aliquam impedit sint animi at quia voluptas."}]},"SecretsUpdateSecretRequestBody":{"title":"SecretsUpdateSecretRequestBody","type":"object","properties":{"key":{"type":"string","description":"Secret key","example":"Consequatur dolorem pariatur quos dicta inventore."},"value":{"type":"string","description":"Secret value","example":"Enim consequatur vero eum quisquam."}},"example":{"key":"Soluta molestiae.","value":"Possimus numquam qui dolor id."}}}}
\ No newline at end of file
diff --git a/backend-go/internal/server/gen/http/openapi.yaml b/backend-go/internal/server/gen/http/openapi.yaml
index 364c1671ba..cea0ad229a 100644
--- a/backend-go/internal/server/gen/http/openapi.yaml
+++ b/backend-go/internal/server/gen/http/openapi.yaml
@@ -34,6 +34,46 @@ paths:
description: Created response.
schema:
$ref: '#/definitions/Project'
+ "400":
+ description: Bad Request response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "401":
+ description: Unauthorized response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "403":
+ description: Forbidden response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "404":
+ description: Not Found response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "500":
+ description: Internal Server Error response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
schemes:
- http
/api/v1/platform/projects/health:
@@ -48,6 +88,46 @@ paths:
description: OK response.
schema:
type: string
+ "400":
+ description: Bad Request response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "401":
+ description: Unauthorized response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "403":
+ description: Forbidden response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "404":
+ description: Not Found response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "500":
+ description: Internal Server Error response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
schemes:
- http
/api/v1/secret-manager/secrets:
@@ -73,6 +153,46 @@ paths:
description: OK response.
schema:
$ref: '#/definitions/SecretsSecretResultResponseCollection'
+ "400":
+ description: Bad Request response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "401":
+ description: Unauthorized response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "403":
+ description: Forbidden response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "404":
+ description: Not Found response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "500":
+ description: Internal Server Error response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
schemes:
- http
post:
@@ -97,6 +217,46 @@ paths:
description: Created response.
schema:
$ref: '#/definitions/Secret'
+ "400":
+ description: Bad Request response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "401":
+ description: Unauthorized response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "403":
+ description: Forbidden response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "404":
+ description: Not Found response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "500":
+ description: Internal Server Error response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
schemes:
- http
/api/v1/secret-manager/secrets/{id}:
@@ -117,6 +277,46 @@ paths:
description: OK response.
schema:
$ref: '#/definitions/Secret'
+ "400":
+ description: Bad Request response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "401":
+ description: Unauthorized response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "403":
+ description: Forbidden response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "404":
+ description: Not Found response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "500":
+ description: Internal Server Error response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
schemes:
- http
delete:
@@ -134,6 +334,46 @@ paths:
responses:
"204":
description: No Content response.
+ "400":
+ description: Bad Request response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "401":
+ description: Unauthorized response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "403":
+ description: Forbidden response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "404":
+ description: Not Found response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "500":
+ description: Internal Server Error response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
schemes:
- http
patch:
@@ -158,6 +398,46 @@ paths:
description: OK response.
schema:
$ref: '#/definitions/Secret'
+ "400":
+ description: Bad Request response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "401":
+ description: Unauthorized response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "403":
+ description: Forbidden response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "404":
+ description: Not Found response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "500":
+ description: Internal Server Error response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
schemes:
- http
/api/v1/secret-manager/secrets/health:
@@ -172,9 +452,79 @@ paths:
description: OK response.
schema:
type: string
+ "400":
+ description: Bad Request response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "401":
+ description: Unauthorized response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "403":
+ description: Forbidden response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "404":
+ description: Not Found response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
+ "500":
+ description: Internal Server Error response.
+ schema:
+ $ref: '#/definitions/APIErrorResult'
+ required:
+ - statusCode
+ - message
+ - error
schemes:
- http
definitions:
+ APIErrorResult:
+ title: APIErrorResult
+ type: object
+ properties:
+ details:
+ description: Optional structured details
+ example: Accusantium error veritatis minus quas.
+ error:
+ type: string
+ description: Error class name
+ example: Cumque non rerum minima.
+ message:
+ type: string
+ description: Human-readable error message
+ example: Dolores et nihil harum.
+ statusCode:
+ type: integer
+ description: HTTP status code
+ example: 5894983497943371786
+ format: int64
+ description: Invalid request
+ example:
+ details: Reprehenderit autem.
+ error: Officiis laudantium vero dolor dignissimos molestiae laboriosam.
+ message: Eveniet magni est.
+ statusCode: 967567680778815670
+ required:
+ - statusCode
+ - message
+ - error
CreateProjectPayload:
title: CreateProjectPayload
type: object
@@ -182,15 +532,15 @@ definitions:
name:
type: string
description: Project name
- example: djc
+ example: nj3
minLength: 1
orgId:
type: string
description: Organization ID
- example: Sequi nobis aut.
+ example: Aut esse nostrum.
example:
- name: 2y8
- orgId: Soluta assumenda eos et voluptatem porro quod.
+ name: eq
+ orgId: Sunt ut similique quibusdam numquam dolorem cum.
required:
- name
- orgId
@@ -201,20 +551,20 @@ definitions:
id:
type: string
description: Project ID
- example: Quis repellendus eos sed cum.
+ example: Eius praesentium doloremque.
name:
type: string
description: Project name
- example: Quibusdam iure officia amet.
+ example: Eum recusandae.
orgId:
type: string
description: Organization ID
- example: Voluptatem consequatur dolorem itaque suscipit sint ratione.
+ example: Culpa tempore.
description: CreateProjectResponseBody result type (default view)
example:
- id: Non enim suscipit consequatur.
- name: Illum architecto aliquid.
- orgId: Debitis vitae.
+ id: Dolores consequatur saepe.
+ name: Ullam iure molestiae.
+ orgId: Quam vitae fugiat ut aut.
required:
- id
- name
@@ -226,30 +576,30 @@ definitions:
environment:
type: string
description: Environment slug
- example: Eum adipisci sunt quis praesentium alias.
+ example: Delectus sed ex vel architecto.
id:
type: string
description: Secret ID
- example: Praesentium et sapiente totam unde officiis necessitatibus.
+ example: Qui facere ipsum dolor.
key:
type: string
description: Secret key
- example: Sit aut.
+ example: Et reiciendis eligendi voluptatem incidunt.
projectId:
type: string
description: Project ID
- example: Odit et vel voluptas aut.
+ example: Voluptas accusamus repellendus.
value:
type: string
description: Secret value
- example: Et rerum eaque rem facilis sit.
+ example: Earum blanditiis consequatur fugiat qui.
description: CreateSecretResponseBody result type (default view)
example:
- environment: Facilis beatae soluta omnis.
- id: Perspiciatis excepturi error rerum adipisci quos.
- key: Dolorem optio blanditiis autem cum totam sint.
- projectId: Sed blanditiis.
- value: Accusantium sit dolorum dolor.
+ environment: Et nisi eius cum qui.
+ id: Ut ratione id.
+ key: Est consectetur culpa debitis consequuntur dicta.
+ projectId: In ab nisi.
+ value: Ex voluptatem animi ullam illum accusamus eveniet.
required:
- id
- key
@@ -263,30 +613,30 @@ definitions:
environment:
type: string
description: Environment slug
- example: Aut optio consectetur temporibus.
+ example: Necessitatibus accusamus dolor voluptatem architecto.
id:
type: string
description: Secret ID
- example: Maxime est quo iure.
+ example: Expedita molestiae ab dolore repellat ut praesentium.
key:
type: string
description: Secret key
- example: Nisi iusto voluptas non aliquam ipsam consequatur.
+ example: Omnis suscipit qui inventore.
projectId:
type: string
description: Project ID
- example: Dolor fugiat maxime nisi quas expedita.
+ example: Et aut facilis aut.
value:
type: string
description: Secret value
- example: Suscipit enim.
+ example: Nihil id aut ut autem soluta.
description: SecretResultResponse result type (default view)
example:
- environment: Nulla et.
- id: Ducimus qui.
- key: Ut aut.
- projectId: Sint neque placeat suscipit delectus ea eligendi.
- value: Qui quasi ducimus vel.
+ environment: Aperiam culpa voluptatum.
+ id: Consequatur aut deleniti velit.
+ key: Rerum sunt quod eaque.
+ projectId: Dolorem fuga quia.
+ value: Voluptatem sapiente corrupti dignissimos officiis ut.
required:
- id
- key
@@ -300,21 +650,16 @@ definitions:
$ref: '#/definitions/SecretResultResponse'
description: ListSecretsResponseBody is the result type for an array of SecretResultResponse (default view)
example:
- - environment: Non quaerat laudantium.
- id: Dolorem libero deleniti molestiae nisi in sunt.
- key: Voluptas quo et ratione.
- projectId: Ea voluptatem ut eius dolorum eius qui.
- value: Qui consequuntur ut sed harum dolore ratione.
- - environment: Non quaerat laudantium.
- id: Dolorem libero deleniti molestiae nisi in sunt.
- key: Voluptas quo et ratione.
- projectId: Ea voluptatem ut eius dolorum eius qui.
- value: Qui consequuntur ut sed harum dolore ratione.
- - environment: Non quaerat laudantium.
- id: Dolorem libero deleniti molestiae nisi in sunt.
- key: Voluptas quo et ratione.
- projectId: Ea voluptatem ut eius dolorum eius qui.
- value: Qui consequuntur ut sed harum dolore ratione.
+ - environment: Maxime est quo iure.
+ id: Sequi id quidem necessitatibus velit.
+ key: Ut repellat et nihil alias veritatis maiores.
+ projectId: Nisi iusto voluptas non aliquam ipsam consequatur.
+ value: Aliquam impedit sint animi at quia voluptas.
+ - environment: Maxime est quo iure.
+ id: Sequi id quidem necessitatibus velit.
+ key: Ut repellat et nihil alias veritatis maiores.
+ projectId: Nisi iusto voluptas non aliquam ipsam consequatur.
+ value: Aliquam impedit sint animi at quia voluptas.
SecretsUpdateSecretRequestBody:
title: SecretsUpdateSecretRequestBody
type: object
@@ -322,11 +667,11 @@ definitions:
key:
type: string
description: Secret key
- example: Dolor modi omnis et non ipsam.
+ example: Consequatur dolorem pariatur quos dicta inventore.
value:
type: string
description: Secret value
- example: Consequatur est sequi id quidem necessitatibus velit.
+ example: Enim consequatur vero eum quisquam.
example:
- key: Ut repellat et nihil alias veritatis maiores.
- value: Aliquam impedit sint animi at quia voluptas.
+ key: Soluta molestiae.
+ value: Possimus numquam qui dolor id.
diff --git a/backend-go/internal/server/gen/http/openapi3.json b/backend-go/internal/server/gen/http/openapi3.json
index 5ddecb45da..0e95ac1266 100644
--- a/backend-go/internal/server/gen/http/openapi3.json
+++ b/backend-go/internal/server/gen/http/openapi3.json
@@ -1 +1 @@
-{"openapi":"3.0.3","info":{"title":"Infisical API","description":"Infisical secret management platform API","version":"0.0.1"},"servers":[{"url":"http://localhost:8080"}],"paths":{"/api/v1/platform/projects":{"post":{"tags":["projects"],"summary":"createProject projects","description":"Create a new project.","operationId":"projects#createProject","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectPayload"},"example":{"name":"hay","orgId":"Id eveniet atque sed."}}}},"responses":{"201":{"description":"Created response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"},"example":{"id":"Eius maxime nemo doloremque magni velit.","name":"Hic mollitia ut ea.","orgId":"Tempora ut sunt nihil aut sunt et."}}}}}}},"/api/v1/platform/projects/health":{"get":{"tags":["projects"],"summary":"getHealth projects","description":"Health check for the projects service.","operationId":"projects#getHealth","responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"string","example":"Voluptates rerum maxime aut placeat rerum quos."},"example":"Laudantium porro."}}}}}},"/api/v1/secret-manager/secrets":{"get":{"tags":["secrets"],"summary":"listSecrets secrets","description":"List secrets for an environment.","operationId":"secrets#listSecrets","parameters":[{"name":"projectId","in":"query","description":"Project ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Project ID","example":"Aperiam optio ea molestias quibusdam nisi quia."},"example":"Eos rerum laborum maiores architecto."},{"name":"environment","in":"query","description":"Environment slug","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Environment slug","example":"Illo dicta exercitationem est."},"example":"Accusamus ut dolorem nemo."}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretResultCollection"},"example":[{"environment":"Magnam quidem necessitatibus minima quia.","id":"Est et omnis nobis.","key":"Inventore similique quae est nesciunt aperiam dolorem.","projectId":"Dolore laudantium occaecati accusamus mollitia voluptas vero.","value":"Animi unde nihil enim."},{"environment":"Magnam quidem necessitatibus minima quia.","id":"Est et omnis nobis.","key":"Inventore similique quae est nesciunt aperiam dolorem.","projectId":"Dolore laudantium occaecati accusamus mollitia voluptas vero.","value":"Animi unde nihil enim."}]}}}}},"post":{"tags":["secrets"],"summary":"createSecret secrets","description":"Create a new secret.","operationId":"secrets#createSecret","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Secret"},"example":{"environment":"Qui eum quos eum pariatur.","key":"DATABASE_URL","projectId":"Deleniti itaque voluptatum.","value":"Reiciendis minima."}}}},"responses":{"201":{"description":"Created response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Secret3"},"example":{"environment":"Ipsa placeat.","id":"Aperiam vel velit repellendus aliquam.","key":"Quia adipisci.","projectId":"Corrupti est et.","value":"Tempore corrupti."}}}}}}},"/api/v1/secret-manager/secrets/health":{"get":{"tags":["secrets"],"summary":"getHealth secrets","description":"Health check for the secrets service.","operationId":"secrets#getHealth","responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"string","example":"Doloremque qui minus consequatur non aut officia."},"example":"Deleniti sunt recusandae."}}}}}},"/api/v1/secret-manager/secrets/{id}":{"delete":{"tags":["secrets"],"summary":"deleteSecret secrets","description":"Delete a secret by ID.","operationId":"secrets#deleteSecret","parameters":[{"name":"id","in":"path","description":"Secret ID","required":true,"schema":{"type":"string","description":"Secret ID","example":"Dolor labore."},"example":"Est aut aliquam placeat ducimus sit."}],"responses":{"204":{"description":"No Content response."}}},"get":{"tags":["secrets"],"summary":"getSecret secrets","description":"Get a secret by ID.","operationId":"secrets#getSecret","parameters":[{"name":"id","in":"path","description":"Secret ID","required":true,"schema":{"type":"string","description":"Secret ID","example":"Corrupti necessitatibus quasi enim."},"example":"Omnis exercitationem optio laborum voluptates sit."}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Secret4"},"example":{"environment":"Quia consequuntur id quasi nostrum.","id":"Consequatur et temporibus incidunt earum.","key":"Iste distinctio.","projectId":"Mollitia velit eum rem sed corrupti ducimus.","value":"Consequatur ea consequatur provident aliquam mollitia."}}}}}},"patch":{"tags":["secrets"],"summary":"updateSecret secrets","description":"Update an existing secret.","operationId":"secrets#updateSecret","parameters":[{"name":"id","in":"path","description":"Secret ID","required":true,"schema":{"type":"string","description":"Secret ID","example":"Eum autem."},"example":"Aspernatur necessitatibus blanditiis."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSecretRequestBody"},"example":{"key":"Omnis autem quo ducimus facilis veritatis.","value":"Eligendi quasi iusto."}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Secret5"},"example":{"environment":"Sed sint voluptatem et et ut.","id":"Quis cupiditate nobis fugiat consectetur.","key":"Necessitatibus aliquid alias nihil.","projectId":"Expedita molestiae repudiandae veritatis.","value":"Ipsa quibusdam vel cupiditate enim optio."}}}}}}}},"components":{"schemas":{"CreateProjectPayload":{"type":"object","properties":{"name":{"type":"string","description":"Project name","example":"3","minLength":1},"orgId":{"type":"string","description":"Organization ID","example":"Tempora voluptas."}},"example":{"name":"q","orgId":"Necessitatibus qui harum ut quo."},"required":["name","orgId"]},"Project":{"type":"object","properties":{"id":{"type":"string","description":"Project ID","example":"Tempora numquam ut ea molestiae est."},"name":{"type":"string","description":"Project name","example":"Et veniam."},"orgId":{"type":"string","description":"Organization ID","example":"Voluptas occaecati quam placeat ut non."}},"example":{"id":"Accusantium aspernatur non repudiandae.","name":"Qui magni voluptatem sint sed.","orgId":"Quaerat neque dolor est."},"required":["id","name","orgId"]},"Secret":{"type":"object","properties":{"environment":{"type":"string","description":"Environment slug","example":"Veritatis nostrum ab quo accusantium."},"key":{"type":"string","description":"Secret key","example":"DATABASE_URL"},"projectId":{"type":"string","description":"Project ID","example":"Quasi sit itaque libero labore ut vitae."},"value":{"type":"string","description":"Secret value","example":"Voluptates temporibus ut consequuntur."}},"example":{"environment":"Nam minus corrupti.","key":"DATABASE_URL","projectId":"Nobis in.","value":"Aut nisi autem."},"required":["key","value","environment","projectId"]},"Secret2":{"type":"object","properties":{"environment":{"type":"string","description":"Environment slug","example":"Repellendus blanditiis corrupti iusto non."},"id":{"type":"string","description":"Secret ID","example":"Voluptatem et veritatis ipsa cum est."},"key":{"type":"string","description":"Secret key","example":"Debitis voluptatem dolore quia corrupti unde."},"projectId":{"type":"string","description":"Project ID","example":"Est perferendis."},"value":{"type":"string","description":"Secret value","example":"Aperiam et mollitia mollitia officia molestiae odio."}},"example":{"environment":"Aut voluptas animi.","id":"Hic et velit temporibus ea necessitatibus.","key":"Iure aut.","projectId":"Cupiditate asperiores tenetur.","value":"Veniam sint quo quas velit."},"required":["id","key","value","environment","projectId"]},"Secret3":{"type":"object","properties":{"environment":{"type":"string","description":"Environment slug","example":"Sed pariatur sunt repudiandae voluptatibus quasi provident."},"id":{"type":"string","description":"Secret ID","example":"Voluptatem sunt et sed."},"key":{"type":"string","description":"Secret key","example":"Et officia ea rerum quidem velit at."},"projectId":{"type":"string","description":"Project ID","example":"Est neque officia aspernatur laudantium molestiae."},"value":{"type":"string","description":"Secret value","example":"Enim qui eum et."}},"example":{"environment":"Delectus ut.","id":"Ut libero tenetur.","key":"Officiis velit amet.","projectId":"Voluptatem est.","value":"Eaque omnis est."},"required":["id","key","value","environment","projectId"]},"Secret4":{"type":"object","properties":{"environment":{"type":"string","description":"Environment slug","example":"Inventore praesentium blanditiis soluta beatae occaecati."},"id":{"type":"string","description":"Secret ID","example":"Omnis veniam."},"key":{"type":"string","description":"Secret key","example":"Explicabo et sed."},"projectId":{"type":"string","description":"Project ID","example":"Impedit enim dignissimos sed magni accusantium facilis."},"value":{"type":"string","description":"Secret value","example":"Eum est consequatur velit eaque quibusdam id."}},"example":{"environment":"Enim molestias at.","id":"Ratione voluptas exercitationem maiores natus.","key":"Et eum dolores tempore ullam possimus quisquam.","projectId":"Consequatur autem pariatur.","value":"Sunt in."},"required":["id","key","value","environment","projectId"]},"Secret5":{"type":"object","properties":{"environment":{"type":"string","description":"Environment slug","example":"Porro et quia tempore quis."},"id":{"type":"string","description":"Secret ID","example":"Voluptas inventore est ut."},"key":{"type":"string","description":"Secret key","example":"Quam rem."},"projectId":{"type":"string","description":"Project ID","example":"Et quia eos incidunt."},"value":{"type":"string","description":"Secret value","example":"Quidem dolor recusandae voluptates et inventore."}},"example":{"environment":"Qui excepturi numquam est accusamus natus qui.","id":"Quod aut exercitationem enim consectetur dolor ut.","key":"Ex delectus.","projectId":"Voluptas nesciunt illum sed magni facere et.","value":"Laboriosam odio repellendus officiis."},"required":["id","key","value","environment","projectId"]},"Secret6":{"type":"object","properties":{"environment":{"type":"string","description":"Environment slug","example":"Quam eius doloribus dolorem odio similique."},"id":{"type":"string","description":"Secret ID","example":"Alias sed aut ut."},"key":{"type":"string","description":"Secret key","example":"Ratione aliquam quas expedita ipsam delectus."},"projectId":{"type":"string","description":"Project ID","example":"Dolor nulla dolore mollitia facilis sed."},"value":{"type":"string","description":"Secret value","example":"Corrupti et velit quod nihil dolor."}},"example":{"environment":"Exercitationem eligendi saepe et earum corporis.","id":"Omnis et ut aliquid atque ipsum vero.","key":"Suscipit velit molestias ratione itaque exercitationem voluptate.","projectId":"Voluptas culpa.","value":"Iste quia."},"required":["id","key","value","environment","projectId"]},"SecretResultCollection":{"type":"array","items":{"$ref":"#/components/schemas/Secret6"},"example":[{"environment":"Magnam quidem necessitatibus minima quia.","id":"Est et omnis nobis.","key":"Inventore similique quae est nesciunt aperiam dolorem.","projectId":"Dolore laudantium occaecati accusamus mollitia voluptas vero.","value":"Animi unde nihil enim."},{"environment":"Magnam quidem necessitatibus minima quia.","id":"Est et omnis nobis.","key":"Inventore similique quae est nesciunt aperiam dolorem.","projectId":"Dolore laudantium occaecati accusamus mollitia voluptas vero.","value":"Animi unde nihil enim."}]},"UpdateSecretRequestBody":{"type":"object","properties":{"key":{"type":"string","description":"Secret key","example":"Et in et quos eius soluta."},"value":{"type":"string","description":"Secret value","example":"Impedit adipisci voluptatem molestiae voluptas nemo."}},"example":{"key":"Unde modi.","value":"Voluptatibus officia magni et ducimus pariatur."}}}},"tags":[{"name":"projects","description":"Service for managing projects."},{"name":"secrets","description":"Service for managing secrets."}]}
\ No newline at end of file
+{"openapi":"3.0.3","info":{"title":"Infisical API","description":"Infisical secret management platform API","version":"0.0.1"},"servers":[{"url":"http://localhost:8080"}],"paths":{"/api/v1/platform/projects":{"post":{"tags":["projects"],"summary":"createProject projects","description":"Create a new project.","operationId":"projects#createProject","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectPayload"}}}},"responses":{"201":{"description":"Created response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"bad_request: Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"401":{"description":"unauthorized: Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"403":{"description":"forbidden: Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"404":{"description":"not_found: Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"500":{"description":"internal_error: Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}}}}},"/api/v1/platform/projects/health":{"get":{"tags":["projects"],"summary":"getHealth projects","description":"Health check for the projects service.","operationId":"projects#getHealth","responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"bad_request: Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"401":{"description":"unauthorized: Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"403":{"description":"forbidden: Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"404":{"description":"not_found: Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"500":{"description":"internal_error: Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}}}}},"/api/v1/secret-manager/secrets":{"get":{"tags":["secrets"],"summary":"listSecrets secrets","description":"List secrets for an environment.","operationId":"secrets#listSecrets","parameters":[{"name":"projectId","in":"query","description":"Project ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Project ID"}},{"name":"environment","in":"query","description":"Environment slug","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Environment slug"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretResultCollection"}}}},"400":{"description":"bad_request: Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"401":{"description":"unauthorized: Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"403":{"description":"forbidden: Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"404":{"description":"not_found: Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"500":{"description":"internal_error: Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}}}},"post":{"tags":["secrets"],"summary":"createSecret secrets","description":"Create a new secret.","operationId":"secrets#createSecret","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Secret"}}}},"responses":{"201":{"description":"Created response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Secret3"}}}},"400":{"description":"bad_request: Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"401":{"description":"unauthorized: Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"403":{"description":"forbidden: Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"404":{"description":"not_found: Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"500":{"description":"internal_error: Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}}}}},"/api/v1/secret-manager/secrets/health":{"get":{"tags":["secrets"],"summary":"getHealth secrets","description":"Health check for the secrets service.","operationId":"secrets#getHealth","responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"bad_request: Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"401":{"description":"unauthorized: Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"403":{"description":"forbidden: Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"404":{"description":"not_found: Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"500":{"description":"internal_error: Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}}}}},"/api/v1/secret-manager/secrets/{id}":{"delete":{"tags":["secrets"],"summary":"deleteSecret secrets","description":"Delete a secret by ID.","operationId":"secrets#deleteSecret","parameters":[{"name":"id","in":"path","description":"Secret ID","required":true,"schema":{"type":"string","description":"Secret ID"}}],"responses":{"204":{"description":"No Content response."},"400":{"description":"bad_request: Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"401":{"description":"unauthorized: Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"403":{"description":"forbidden: Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"404":{"description":"not_found: Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"500":{"description":"internal_error: Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}}}},"get":{"tags":["secrets"],"summary":"getSecret secrets","description":"Get a secret by ID.","operationId":"secrets#getSecret","parameters":[{"name":"id","in":"path","description":"Secret ID","required":true,"schema":{"type":"string","description":"Secret ID"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Secret4"}}}},"400":{"description":"bad_request: Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"401":{"description":"unauthorized: Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"403":{"description":"forbidden: Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"404":{"description":"not_found: Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"500":{"description":"internal_error: Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}}}},"patch":{"tags":["secrets"],"summary":"updateSecret secrets","description":"Update an existing secret.","operationId":"secrets#updateSecret","parameters":[{"name":"id","in":"path","description":"Secret ID","required":true,"schema":{"type":"string","description":"Secret ID"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSecretRequestBody"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Secret5"}}}},"400":{"description":"bad_request: Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"401":{"description":"unauthorized: Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"403":{"description":"forbidden: Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"404":{"description":"not_found: Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}},"500":{"description":"internal_error: Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResult"}}}}}}}},"components":{"schemas":{"APIErrorResult":{"type":"object","properties":{"details":{"description":"Optional structured details"},"error":{"type":"string","description":"Error class name"},"message":{"type":"string","description":"Human-readable error message"},"statusCode":{"type":"integer","description":"HTTP status code","format":"int64"}},"required":["statusCode","message","error"]},"CreateProjectPayload":{"type":"object","properties":{"name":{"type":"string","description":"Project name","minLength":1},"orgId":{"type":"string","description":"Organization ID"}},"required":["name","orgId"]},"Project":{"type":"object","properties":{"id":{"type":"string","description":"Project ID"},"name":{"type":"string","description":"Project name"},"orgId":{"type":"string","description":"Organization ID"}},"required":["id","name","orgId"]},"Secret":{"type":"object","properties":{"environment":{"type":"string","description":"Environment slug"},"key":{"type":"string","description":"Secret key","example":"DATABASE_URL"},"projectId":{"type":"string","description":"Project ID"},"value":{"type":"string","description":"Secret value"}},"required":["key","value","environment","projectId"]},"Secret2":{"type":"object","properties":{"environment":{"type":"string","description":"Environment slug"},"id":{"type":"string","description":"Secret ID"},"key":{"type":"string","description":"Secret key"},"projectId":{"type":"string","description":"Project ID"},"value":{"type":"string","description":"Secret value"}},"required":["id","key","value","environment","projectId"]},"Secret3":{"type":"object","properties":{"environment":{"type":"string","description":"Environment slug"},"id":{"type":"string","description":"Secret ID"},"key":{"type":"string","description":"Secret key"},"projectId":{"type":"string","description":"Project ID"},"value":{"type":"string","description":"Secret value"}},"required":["id","key","value","environment","projectId"]},"Secret4":{"type":"object","properties":{"environment":{"type":"string","description":"Environment slug"},"id":{"type":"string","description":"Secret ID"},"key":{"type":"string","description":"Secret key"},"projectId":{"type":"string","description":"Project ID"},"value":{"type":"string","description":"Secret value"}},"required":["id","key","value","environment","projectId"]},"Secret5":{"type":"object","properties":{"environment":{"type":"string","description":"Environment slug"},"id":{"type":"string","description":"Secret ID"},"key":{"type":"string","description":"Secret key"},"projectId":{"type":"string","description":"Project ID"},"value":{"type":"string","description":"Secret value"}},"required":["id","key","value","environment","projectId"]},"Secret6":{"type":"object","properties":{"environment":{"type":"string","description":"Environment slug"},"id":{"type":"string","description":"Secret ID"},"key":{"type":"string","description":"Secret key"},"projectId":{"type":"string","description":"Project ID"},"value":{"type":"string","description":"Secret value"}},"required":["id","key","value","environment","projectId"]},"SecretResultCollection":{"type":"array","items":{"$ref":"#/components/schemas/Secret6"}},"UpdateSecretRequestBody":{"type":"object","properties":{"key":{"type":"string","description":"Secret key"},"value":{"type":"string","description":"Secret value"}}}}},"tags":[{"name":"projects","description":"Service for managing projects."},{"name":"secrets","description":"Service for managing secrets."}]}
\ No newline at end of file
diff --git a/backend-go/internal/server/gen/http/openapi3.yaml b/backend-go/internal/server/gen/http/openapi3.yaml
index 20938cbbe9..8a9e6bcc05 100644
--- a/backend-go/internal/server/gen/http/openapi3.yaml
+++ b/backend-go/internal/server/gen/http/openapi3.yaml
@@ -19,9 +19,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/CreateProjectPayload'
- example:
- name: hay
- orgId: Id eveniet atque sed.
responses:
"201":
description: Created response.
@@ -29,10 +26,36 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Project'
- example:
- id: Eius maxime nemo doloremque magni velit.
- name: Hic mollitia ut ea.
- orgId: Tempora ut sunt nihil aut sunt et.
+ "400":
+ description: 'bad_request: Invalid request'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "401":
+ description: 'unauthorized: Authentication required'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "403":
+ description: 'forbidden: Permission denied'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "404":
+ description: 'not_found: Resource not found'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "500":
+ description: 'internal_error: Internal server error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
/api/v1/platform/projects/health:
get:
tags:
@@ -47,8 +70,36 @@ paths:
application/json:
schema:
type: string
- example: Voluptates rerum maxime aut placeat rerum quos.
- example: Laudantium porro.
+ "400":
+ description: 'bad_request: Invalid request'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "401":
+ description: 'unauthorized: Authentication required'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "403":
+ description: 'forbidden: Permission denied'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "404":
+ description: 'not_found: Resource not found'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "500":
+ description: 'internal_error: Internal server error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
/api/v1/secret-manager/secrets:
get:
tags:
@@ -65,8 +116,6 @@ paths:
schema:
type: string
description: Project ID
- example: Aperiam optio ea molestias quibusdam nisi quia.
- example: Eos rerum laborum maiores architecto.
- name: environment
in: query
description: Environment slug
@@ -75,8 +124,6 @@ paths:
schema:
type: string
description: Environment slug
- example: Illo dicta exercitationem est.
- example: Accusamus ut dolorem nemo.
responses:
"200":
description: OK response.
@@ -84,17 +131,36 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/SecretResultCollection'
- example:
- - environment: Magnam quidem necessitatibus minima quia.
- id: Est et omnis nobis.
- key: Inventore similique quae est nesciunt aperiam dolorem.
- projectId: Dolore laudantium occaecati accusamus mollitia voluptas vero.
- value: Animi unde nihil enim.
- - environment: Magnam quidem necessitatibus minima quia.
- id: Est et omnis nobis.
- key: Inventore similique quae est nesciunt aperiam dolorem.
- projectId: Dolore laudantium occaecati accusamus mollitia voluptas vero.
- value: Animi unde nihil enim.
+ "400":
+ description: 'bad_request: Invalid request'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "401":
+ description: 'unauthorized: Authentication required'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "403":
+ description: 'forbidden: Permission denied'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "404":
+ description: 'not_found: Resource not found'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "500":
+ description: 'internal_error: Internal server error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
post:
tags:
- secrets
@@ -107,11 +173,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Secret'
- example:
- environment: Qui eum quos eum pariatur.
- key: DATABASE_URL
- projectId: Deleniti itaque voluptatum.
- value: Reiciendis minima.
responses:
"201":
description: Created response.
@@ -119,12 +180,36 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Secret3'
- example:
- environment: Ipsa placeat.
- id: Aperiam vel velit repellendus aliquam.
- key: Quia adipisci.
- projectId: Corrupti est et.
- value: Tempore corrupti.
+ "400":
+ description: 'bad_request: Invalid request'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "401":
+ description: 'unauthorized: Authentication required'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "403":
+ description: 'forbidden: Permission denied'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "404":
+ description: 'not_found: Resource not found'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "500":
+ description: 'internal_error: Internal server error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
/api/v1/secret-manager/secrets/{id}:
delete:
tags:
@@ -140,11 +225,39 @@ paths:
schema:
type: string
description: Secret ID
- example: Dolor labore.
- example: Est aut aliquam placeat ducimus sit.
responses:
"204":
description: No Content response.
+ "400":
+ description: 'bad_request: Invalid request'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "401":
+ description: 'unauthorized: Authentication required'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "403":
+ description: 'forbidden: Permission denied'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "404":
+ description: 'not_found: Resource not found'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "500":
+ description: 'internal_error: Internal server error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
get:
tags:
- secrets
@@ -159,8 +272,6 @@ paths:
schema:
type: string
description: Secret ID
- example: Corrupti necessitatibus quasi enim.
- example: Omnis exercitationem optio laborum voluptates sit.
responses:
"200":
description: OK response.
@@ -168,12 +279,36 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Secret4'
- example:
- environment: Quia consequuntur id quasi nostrum.
- id: Consequatur et temporibus incidunt earum.
- key: Iste distinctio.
- projectId: Mollitia velit eum rem sed corrupti ducimus.
- value: Consequatur ea consequatur provident aliquam mollitia.
+ "400":
+ description: 'bad_request: Invalid request'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "401":
+ description: 'unauthorized: Authentication required'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "403":
+ description: 'forbidden: Permission denied'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "404":
+ description: 'not_found: Resource not found'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "500":
+ description: 'internal_error: Internal server error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
patch:
tags:
- secrets
@@ -188,17 +323,12 @@ paths:
schema:
type: string
description: Secret ID
- example: Eum autem.
- example: Aspernatur necessitatibus blanditiis.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateSecretRequestBody'
- example:
- key: Omnis autem quo ducimus facilis veritatis.
- value: Eligendi quasi iusto.
responses:
"200":
description: OK response.
@@ -206,12 +336,36 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Secret5'
- example:
- environment: Sed sint voluptatem et et ut.
- id: Quis cupiditate nobis fugiat consectetur.
- key: Necessitatibus aliquid alias nihil.
- projectId: Expedita molestiae repudiandae veritatis.
- value: Ipsa quibusdam vel cupiditate enim optio.
+ "400":
+ description: 'bad_request: Invalid request'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "401":
+ description: 'unauthorized: Authentication required'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "403":
+ description: 'forbidden: Permission denied'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "404":
+ description: 'not_found: Resource not found'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "500":
+ description: 'internal_error: Internal server error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
/api/v1/secret-manager/secrets/health:
get:
tags:
@@ -226,25 +380,67 @@ paths:
application/json:
schema:
type: string
- example: Doloremque qui minus consequatur non aut officia.
- example: Deleniti sunt recusandae.
+ "400":
+ description: 'bad_request: Invalid request'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "401":
+ description: 'unauthorized: Authentication required'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "403":
+ description: 'forbidden: Permission denied'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "404":
+ description: 'not_found: Resource not found'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
+ "500":
+ description: 'internal_error: Internal server error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIErrorResult'
components:
schemas:
+ APIErrorResult:
+ type: object
+ properties:
+ details:
+ description: Optional structured details
+ error:
+ type: string
+ description: Error class name
+ message:
+ type: string
+ description: Human-readable error message
+ statusCode:
+ type: integer
+ description: HTTP status code
+ format: int64
+ required:
+ - statusCode
+ - message
+ - error
CreateProjectPayload:
type: object
properties:
name:
type: string
description: Project name
- example: "3"
minLength: 1
orgId:
type: string
description: Organization ID
- example: Tempora voluptas.
- example:
- name: q
- orgId: Necessitatibus qui harum ut quo.
required:
- name
- orgId
@@ -254,19 +450,12 @@ components:
id:
type: string
description: Project ID
- example: Tempora numquam ut ea molestiae est.
name:
type: string
description: Project name
- example: Et veniam.
orgId:
type: string
description: Organization ID
- example: Voluptas occaecati quam placeat ut non.
- example:
- id: Accusantium aspernatur non repudiandae.
- name: Qui magni voluptatem sint sed.
- orgId: Quaerat neque dolor est.
required:
- id
- name
@@ -277,7 +466,6 @@ components:
environment:
type: string
description: Environment slug
- example: Veritatis nostrum ab quo accusantium.
key:
type: string
description: Secret key
@@ -285,16 +473,9 @@ components:
projectId:
type: string
description: Project ID
- example: Quasi sit itaque libero labore ut vitae.
value:
type: string
description: Secret value
- example: Voluptates temporibus ut consequuntur.
- example:
- environment: Nam minus corrupti.
- key: DATABASE_URL
- projectId: Nobis in.
- value: Aut nisi autem.
required:
- key
- value
@@ -306,29 +487,18 @@ components:
environment:
type: string
description: Environment slug
- example: Repellendus blanditiis corrupti iusto non.
id:
type: string
description: Secret ID
- example: Voluptatem et veritatis ipsa cum est.
key:
type: string
description: Secret key
- example: Debitis voluptatem dolore quia corrupti unde.
projectId:
type: string
description: Project ID
- example: Est perferendis.
value:
type: string
description: Secret value
- example: Aperiam et mollitia mollitia officia molestiae odio.
- example:
- environment: Aut voluptas animi.
- id: Hic et velit temporibus ea necessitatibus.
- key: Iure aut.
- projectId: Cupiditate asperiores tenetur.
- value: Veniam sint quo quas velit.
required:
- id
- key
@@ -341,29 +511,18 @@ components:
environment:
type: string
description: Environment slug
- example: Sed pariatur sunt repudiandae voluptatibus quasi provident.
id:
type: string
description: Secret ID
- example: Voluptatem sunt et sed.
key:
type: string
description: Secret key
- example: Et officia ea rerum quidem velit at.
projectId:
type: string
description: Project ID
- example: Est neque officia aspernatur laudantium molestiae.
value:
type: string
description: Secret value
- example: Enim qui eum et.
- example:
- environment: Delectus ut.
- id: Ut libero tenetur.
- key: Officiis velit amet.
- projectId: Voluptatem est.
- value: Eaque omnis est.
required:
- id
- key
@@ -376,29 +535,18 @@ components:
environment:
type: string
description: Environment slug
- example: Inventore praesentium blanditiis soluta beatae occaecati.
id:
type: string
description: Secret ID
- example: Omnis veniam.
key:
type: string
description: Secret key
- example: Explicabo et sed.
projectId:
type: string
description: Project ID
- example: Impedit enim dignissimos sed magni accusantium facilis.
value:
type: string
description: Secret value
- example: Eum est consequatur velit eaque quibusdam id.
- example:
- environment: Enim molestias at.
- id: Ratione voluptas exercitationem maiores natus.
- key: Et eum dolores tempore ullam possimus quisquam.
- projectId: Consequatur autem pariatur.
- value: Sunt in.
required:
- id
- key
@@ -411,29 +559,18 @@ components:
environment:
type: string
description: Environment slug
- example: Porro et quia tempore quis.
id:
type: string
description: Secret ID
- example: Voluptas inventore est ut.
key:
type: string
description: Secret key
- example: Quam rem.
projectId:
type: string
description: Project ID
- example: Et quia eos incidunt.
value:
type: string
description: Secret value
- example: Quidem dolor recusandae voluptates et inventore.
- example:
- environment: Qui excepturi numquam est accusamus natus qui.
- id: Quod aut exercitationem enim consectetur dolor ut.
- key: Ex delectus.
- projectId: Voluptas nesciunt illum sed magni facere et.
- value: Laboriosam odio repellendus officiis.
required:
- id
- key
@@ -446,29 +583,18 @@ components:
environment:
type: string
description: Environment slug
- example: Quam eius doloribus dolorem odio similique.
id:
type: string
description: Secret ID
- example: Alias sed aut ut.
key:
type: string
description: Secret key
- example: Ratione aliquam quas expedita ipsam delectus.
projectId:
type: string
description: Project ID
- example: Dolor nulla dolore mollitia facilis sed.
value:
type: string
description: Secret value
- example: Corrupti et velit quod nihil dolor.
- example:
- environment: Exercitationem eligendi saepe et earum corporis.
- id: Omnis et ut aliquid atque ipsum vero.
- key: Suscipit velit molestias ratione itaque exercitationem voluptate.
- projectId: Voluptas culpa.
- value: Iste quia.
required:
- id
- key
@@ -479,31 +605,15 @@ components:
type: array
items:
$ref: '#/components/schemas/Secret6'
- example:
- - environment: Magnam quidem necessitatibus minima quia.
- id: Est et omnis nobis.
- key: Inventore similique quae est nesciunt aperiam dolorem.
- projectId: Dolore laudantium occaecati accusamus mollitia voluptas vero.
- value: Animi unde nihil enim.
- - environment: Magnam quidem necessitatibus minima quia.
- id: Est et omnis nobis.
- key: Inventore similique quae est nesciunt aperiam dolorem.
- projectId: Dolore laudantium occaecati accusamus mollitia voluptas vero.
- value: Animi unde nihil enim.
UpdateSecretRequestBody:
type: object
properties:
key:
type: string
description: Secret key
- example: Et in et quos eius soluta.
value:
type: string
description: Secret value
- example: Impedit adipisci voluptatem molestiae voluptas nemo.
- example:
- key: Unde modi.
- value: Voluptatibus officia magni et ducimus pariatur.
tags:
- name: projects
description: Service for managing projects.
diff --git a/backend-go/internal/server/gen/http/projects/client/cli.go b/backend-go/internal/server/gen/http/projects/client/cli.go
index abdeebcbf8..273e7fe31d 100644
--- a/backend-go/internal/server/gen/http/projects/client/cli.go
+++ b/backend-go/internal/server/gen/http/projects/client/cli.go
@@ -25,7 +25,7 @@ func BuildCreateProjectPayload(projectsCreateProjectBody string) (*projects.Crea
{
err = json.Unmarshal([]byte(projectsCreateProjectBody), &body)
if err != nil {
- return nil, fmt.Errorf("invalid JSON for body, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"name\": \"hay\",\n \"orgId\": \"Id eveniet atque sed.\"\n }'")
+ return nil, fmt.Errorf("invalid JSON for body, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"name\": \"a9\",\n \"orgId\": \"Eius dolorum eius qui repellendus aperiam vel.\"\n }'")
}
if utf8.RuneCountInString(body.Name) < 1 {
err = goa.MergeErrors(err, goa.InvalidLengthError("body.name", body.Name, utf8.RuneCountInString(body.Name), 1, true))
diff --git a/backend-go/internal/server/gen/http/projects/client/encode_decode.go b/backend-go/internal/server/gen/http/projects/client/encode_decode.go
index 853fd68647..e9a8809d76 100644
--- a/backend-go/internal/server/gen/http/projects/client/encode_decode.go
+++ b/backend-go/internal/server/gen/http/projects/client/encode_decode.go
@@ -38,6 +38,13 @@ func (c *Client) BuildGetHealthRequest(ctx context.Context, v any) (*http.Reques
// DecodeGetHealthResponse returns a decoder for responses returned by the
// projects getHealth endpoint. restoreBody controls whether the response body
// should be restored after having been read.
+// DecodeGetHealthResponse may return the following errors:
+// - "bad_request" (type *projects.APIErrorResult): http.StatusBadRequest
+// - "unauthorized" (type *projects.APIErrorResult): http.StatusUnauthorized
+// - "forbidden" (type *projects.APIErrorResult): http.StatusForbidden
+// - "not_found" (type *projects.APIErrorResult): http.StatusNotFound
+// - "internal_error" (type *projects.APIErrorResult): http.StatusInternalServerError
+// - error: internal error
func DecodeGetHealthResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) {
return func(resp *http.Response) (any, error) {
if restoreBody {
@@ -63,6 +70,76 @@ func DecodeGetHealthResponse(decoder func(*http.Response) goahttp.Decoder, resto
return nil, goahttp.ErrDecodingError("projects", "getHealth", err)
}
return body, nil
+ case http.StatusBadRequest:
+ var (
+ body GetHealthBadRequestResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("projects", "getHealth", err)
+ }
+ err = ValidateGetHealthBadRequestResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("projects", "getHealth", err)
+ }
+ return nil, NewGetHealthBadRequest(&body)
+ case http.StatusUnauthorized:
+ var (
+ body GetHealthUnauthorizedResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("projects", "getHealth", err)
+ }
+ err = ValidateGetHealthUnauthorizedResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("projects", "getHealth", err)
+ }
+ return nil, NewGetHealthUnauthorized(&body)
+ case http.StatusForbidden:
+ var (
+ body GetHealthForbiddenResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("projects", "getHealth", err)
+ }
+ err = ValidateGetHealthForbiddenResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("projects", "getHealth", err)
+ }
+ return nil, NewGetHealthForbidden(&body)
+ case http.StatusNotFound:
+ var (
+ body GetHealthNotFoundResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("projects", "getHealth", err)
+ }
+ err = ValidateGetHealthNotFoundResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("projects", "getHealth", err)
+ }
+ return nil, NewGetHealthNotFound(&body)
+ case http.StatusInternalServerError:
+ var (
+ body GetHealthInternalErrorResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("projects", "getHealth", err)
+ }
+ err = ValidateGetHealthInternalErrorResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("projects", "getHealth", err)
+ }
+ return nil, NewGetHealthInternalError(&body)
default:
body, _ := io.ReadAll(resp.Body)
return nil, goahttp.ErrInvalidResponse("projects", "getHealth", resp.StatusCode, string(body))
@@ -104,6 +181,13 @@ func EncodeCreateProjectRequest(encoder func(*http.Request) goahttp.Encoder) fun
// DecodeCreateProjectResponse returns a decoder for responses returned by the
// projects createProject endpoint. restoreBody controls whether the response
// body should be restored after having been read.
+// DecodeCreateProjectResponse may return the following errors:
+// - "bad_request" (type *projects.APIErrorResult): http.StatusBadRequest
+// - "unauthorized" (type *projects.APIErrorResult): http.StatusUnauthorized
+// - "forbidden" (type *projects.APIErrorResult): http.StatusForbidden
+// - "not_found" (type *projects.APIErrorResult): http.StatusNotFound
+// - "internal_error" (type *projects.APIErrorResult): http.StatusInternalServerError
+// - error: internal error
func DecodeCreateProjectResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) {
return func(resp *http.Response) (any, error) {
if restoreBody {
@@ -136,6 +220,76 @@ func DecodeCreateProjectResponse(decoder func(*http.Response) goahttp.Decoder, r
}
res := projects.NewProjectResult(vres)
return res, nil
+ case http.StatusBadRequest:
+ var (
+ body CreateProjectBadRequestResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("projects", "createProject", err)
+ }
+ err = ValidateCreateProjectBadRequestResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("projects", "createProject", err)
+ }
+ return nil, NewCreateProjectBadRequest(&body)
+ case http.StatusUnauthorized:
+ var (
+ body CreateProjectUnauthorizedResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("projects", "createProject", err)
+ }
+ err = ValidateCreateProjectUnauthorizedResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("projects", "createProject", err)
+ }
+ return nil, NewCreateProjectUnauthorized(&body)
+ case http.StatusForbidden:
+ var (
+ body CreateProjectForbiddenResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("projects", "createProject", err)
+ }
+ err = ValidateCreateProjectForbiddenResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("projects", "createProject", err)
+ }
+ return nil, NewCreateProjectForbidden(&body)
+ case http.StatusNotFound:
+ var (
+ body CreateProjectNotFoundResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("projects", "createProject", err)
+ }
+ err = ValidateCreateProjectNotFoundResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("projects", "createProject", err)
+ }
+ return nil, NewCreateProjectNotFound(&body)
+ case http.StatusInternalServerError:
+ var (
+ body CreateProjectInternalErrorResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("projects", "createProject", err)
+ }
+ err = ValidateCreateProjectInternalErrorResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("projects", "createProject", err)
+ }
+ return nil, NewCreateProjectInternalError(&body)
default:
body, _ := io.ReadAll(resp.Body)
return nil, goahttp.ErrInvalidResponse("projects", "createProject", resp.StatusCode, string(body))
diff --git a/backend-go/internal/server/gen/http/projects/client/types.go b/backend-go/internal/server/gen/http/projects/client/types.go
index 0753835da2..3670d7e4fc 100644
--- a/backend-go/internal/server/gen/http/projects/client/types.go
+++ b/backend-go/internal/server/gen/http/projects/client/types.go
@@ -11,6 +11,7 @@ package client
import (
projects "github.com/infisical/api/internal/server/gen/projects"
projectsviews "github.com/infisical/api/internal/server/gen/projects/views"
+ goa "goa.design/goa/v3/pkg"
)
// CreateProjectRequestBody is the type of the "projects" service
@@ -33,6 +34,136 @@ type CreateProjectResponseBody struct {
OrgID *string `form:"orgId,omitempty" json:"orgId,omitempty" xml:"orgId,omitempty"`
}
+// GetHealthBadRequestResponseBody is the type of the "projects" service
+// "getHealth" endpoint HTTP response body for the "bad_request" error.
+type GetHealthBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthUnauthorizedResponseBody is the type of the "projects" service
+// "getHealth" endpoint HTTP response body for the "unauthorized" error.
+type GetHealthUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthForbiddenResponseBody is the type of the "projects" service
+// "getHealth" endpoint HTTP response body for the "forbidden" error.
+type GetHealthForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthNotFoundResponseBody is the type of the "projects" service
+// "getHealth" endpoint HTTP response body for the "not_found" error.
+type GetHealthNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthInternalErrorResponseBody is the type of the "projects" service
+// "getHealth" endpoint HTTP response body for the "internal_error" error.
+type GetHealthInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateProjectBadRequestResponseBody is the type of the "projects" service
+// "createProject" endpoint HTTP response body for the "bad_request" error.
+type CreateProjectBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateProjectUnauthorizedResponseBody is the type of the "projects" service
+// "createProject" endpoint HTTP response body for the "unauthorized" error.
+type CreateProjectUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateProjectForbiddenResponseBody is the type of the "projects" service
+// "createProject" endpoint HTTP response body for the "forbidden" error.
+type CreateProjectForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateProjectNotFoundResponseBody is the type of the "projects" service
+// "createProject" endpoint HTTP response body for the "not_found" error.
+type CreateProjectNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateProjectInternalErrorResponseBody is the type of the "projects" service
+// "createProject" endpoint HTTP response body for the "internal_error" error.
+type CreateProjectInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
// NewCreateProjectRequestBody builds the HTTP request body from the payload of
// the "createProject" endpoint of the "projects" service.
func NewCreateProjectRequestBody(p *projects.CreateProjectPayload) *CreateProjectRequestBody {
@@ -43,6 +174,71 @@ func NewCreateProjectRequestBody(p *projects.CreateProjectPayload) *CreateProjec
return body
}
+// NewGetHealthBadRequest builds a projects service getHealth endpoint
+// bad_request error.
+func NewGetHealthBadRequest(body *GetHealthBadRequestResponseBody) *projects.APIErrorResult {
+ v := &projects.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewGetHealthUnauthorized builds a projects service getHealth endpoint
+// unauthorized error.
+func NewGetHealthUnauthorized(body *GetHealthUnauthorizedResponseBody) *projects.APIErrorResult {
+ v := &projects.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewGetHealthForbidden builds a projects service getHealth endpoint forbidden
+// error.
+func NewGetHealthForbidden(body *GetHealthForbiddenResponseBody) *projects.APIErrorResult {
+ v := &projects.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewGetHealthNotFound builds a projects service getHealth endpoint not_found
+// error.
+func NewGetHealthNotFound(body *GetHealthNotFoundResponseBody) *projects.APIErrorResult {
+ v := &projects.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewGetHealthInternalError builds a projects service getHealth endpoint
+// internal_error error.
+func NewGetHealthInternalError(body *GetHealthInternalErrorResponseBody) *projects.APIErrorResult {
+ v := &projects.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
// NewCreateProjectProjectResultCreated builds a "projects" service
// "createProject" endpoint result from a HTTP "Created" response.
func NewCreateProjectProjectResultCreated(body *CreateProjectResponseBody) *projectsviews.ProjectResultView {
@@ -54,3 +250,218 @@ func NewCreateProjectProjectResultCreated(body *CreateProjectResponseBody) *proj
return v
}
+
+// NewCreateProjectBadRequest builds a projects service createProject endpoint
+// bad_request error.
+func NewCreateProjectBadRequest(body *CreateProjectBadRequestResponseBody) *projects.APIErrorResult {
+ v := &projects.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewCreateProjectUnauthorized builds a projects service createProject
+// endpoint unauthorized error.
+func NewCreateProjectUnauthorized(body *CreateProjectUnauthorizedResponseBody) *projects.APIErrorResult {
+ v := &projects.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewCreateProjectForbidden builds a projects service createProject endpoint
+// forbidden error.
+func NewCreateProjectForbidden(body *CreateProjectForbiddenResponseBody) *projects.APIErrorResult {
+ v := &projects.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewCreateProjectNotFound builds a projects service createProject endpoint
+// not_found error.
+func NewCreateProjectNotFound(body *CreateProjectNotFoundResponseBody) *projects.APIErrorResult {
+ v := &projects.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewCreateProjectInternalError builds a projects service createProject
+// endpoint internal_error error.
+func NewCreateProjectInternalError(body *CreateProjectInternalErrorResponseBody) *projects.APIErrorResult {
+ v := &projects.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// ValidateGetHealthBadRequestResponseBody runs the validations defined on
+// getHealth_bad_request_response_body
+func ValidateGetHealthBadRequestResponseBody(body *GetHealthBadRequestResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetHealthUnauthorizedResponseBody runs the validations defined on
+// getHealth_unauthorized_response_body
+func ValidateGetHealthUnauthorizedResponseBody(body *GetHealthUnauthorizedResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetHealthForbiddenResponseBody runs the validations defined on
+// getHealth_forbidden_response_body
+func ValidateGetHealthForbiddenResponseBody(body *GetHealthForbiddenResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetHealthNotFoundResponseBody runs the validations defined on
+// getHealth_not_found_response_body
+func ValidateGetHealthNotFoundResponseBody(body *GetHealthNotFoundResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetHealthInternalErrorResponseBody runs the validations defined on
+// getHealth_internal_error_response_body
+func ValidateGetHealthInternalErrorResponseBody(body *GetHealthInternalErrorResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateCreateProjectBadRequestResponseBody runs the validations defined on
+// createProject_bad_request_response_body
+func ValidateCreateProjectBadRequestResponseBody(body *CreateProjectBadRequestResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateCreateProjectUnauthorizedResponseBody runs the validations defined
+// on createProject_unauthorized_response_body
+func ValidateCreateProjectUnauthorizedResponseBody(body *CreateProjectUnauthorizedResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateCreateProjectForbiddenResponseBody runs the validations defined on
+// createProject_forbidden_response_body
+func ValidateCreateProjectForbiddenResponseBody(body *CreateProjectForbiddenResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateCreateProjectNotFoundResponseBody runs the validations defined on
+// createProject_not_found_response_body
+func ValidateCreateProjectNotFoundResponseBody(body *CreateProjectNotFoundResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateCreateProjectInternalErrorResponseBody runs the validations defined
+// on createProject_internal_error_response_body
+func ValidateCreateProjectInternalErrorResponseBody(body *CreateProjectInternalErrorResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
diff --git a/backend-go/internal/server/gen/http/projects/server/encode_decode.go b/backend-go/internal/server/gen/http/projects/server/encode_decode.go
index 646b8066d6..b6f3f5e7d6 100644
--- a/backend-go/internal/server/gen/http/projects/server/encode_decode.go
+++ b/backend-go/internal/server/gen/http/projects/server/encode_decode.go
@@ -32,6 +32,87 @@ func EncodeGetHealthResponse(encoder func(context.Context, http.ResponseWriter)
}
}
+// EncodeGetHealthError returns an encoder for errors returned by the getHealth
+// projects endpoint.
+func EncodeGetHealthError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
+ encodeError := goahttp.ErrorEncoder(encoder, formatter)
+ return func(ctx context.Context, w http.ResponseWriter, v error) error {
+ var en goa.GoaErrorNamer
+ if !errors.As(v, &en) {
+ return encodeError(ctx, w, v)
+ }
+ switch en.GoaErrorName() {
+ case "bad_request":
+ var res *projects.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetHealthBadRequestResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusBadRequest)
+ return enc.Encode(body)
+ case "unauthorized":
+ var res *projects.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetHealthUnauthorizedResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusUnauthorized)
+ return enc.Encode(body)
+ case "forbidden":
+ var res *projects.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetHealthForbiddenResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusForbidden)
+ return enc.Encode(body)
+ case "not_found":
+ var res *projects.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetHealthNotFoundResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusNotFound)
+ return enc.Encode(body)
+ case "internal_error":
+ var res *projects.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetHealthInternalErrorResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusInternalServerError)
+ return enc.Encode(body)
+ default:
+ return encodeError(ctx, w, v)
+ }
+ }
+}
+
// EncodeCreateProjectResponse returns an encoder for responses returned by the
// projects createProject endpoint.
func EncodeCreateProjectResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error {
@@ -73,3 +154,84 @@ func DecodeCreateProjectRequest(mux goahttp.Muxer, decoder func(*http.Request) g
return payload, nil
}
}
+
+// EncodeCreateProjectError returns an encoder for errors returned by the
+// createProject projects endpoint.
+func EncodeCreateProjectError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
+ encodeError := goahttp.ErrorEncoder(encoder, formatter)
+ return func(ctx context.Context, w http.ResponseWriter, v error) error {
+ var en goa.GoaErrorNamer
+ if !errors.As(v, &en) {
+ return encodeError(ctx, w, v)
+ }
+ switch en.GoaErrorName() {
+ case "bad_request":
+ var res *projects.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewCreateProjectBadRequestResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusBadRequest)
+ return enc.Encode(body)
+ case "unauthorized":
+ var res *projects.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewCreateProjectUnauthorizedResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusUnauthorized)
+ return enc.Encode(body)
+ case "forbidden":
+ var res *projects.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewCreateProjectForbiddenResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusForbidden)
+ return enc.Encode(body)
+ case "not_found":
+ var res *projects.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewCreateProjectNotFoundResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusNotFound)
+ return enc.Encode(body)
+ case "internal_error":
+ var res *projects.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewCreateProjectInternalErrorResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusInternalServerError)
+ return enc.Encode(body)
+ default:
+ return encodeError(ctx, w, v)
+ }
+ }
+}
diff --git a/backend-go/internal/server/gen/http/projects/server/server.go b/backend-go/internal/server/gen/http/projects/server/server.go
index 6918b050d5..581211f22f 100644
--- a/backend-go/internal/server/gen/http/projects/server/server.go
+++ b/backend-go/internal/server/gen/http/projects/server/server.go
@@ -106,7 +106,7 @@ func NewGetHealthHandler(
) http.Handler {
var (
encodeResponse = EncodeGetHealthResponse(encoder)
- encodeError = goahttp.ErrorEncoder(encoder, formatter)
+ encodeError = EncodeGetHealthError(encoder, formatter)
)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept"))
@@ -153,7 +153,7 @@ func NewCreateProjectHandler(
var (
decodeRequest = DecodeCreateProjectRequest(mux, decoder)
encodeResponse = EncodeCreateProjectResponse(encoder)
- encodeError = goahttp.ErrorEncoder(encoder, formatter)
+ encodeError = EncodeCreateProjectError(encoder, formatter)
)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept"))
diff --git a/backend-go/internal/server/gen/http/projects/server/types.go b/backend-go/internal/server/gen/http/projects/server/types.go
index 443bb73faa..22538de554 100644
--- a/backend-go/internal/server/gen/http/projects/server/types.go
+++ b/backend-go/internal/server/gen/http/projects/server/types.go
@@ -36,6 +36,136 @@ type CreateProjectResponseBody struct {
OrgID string `form:"orgId" json:"orgId" xml:"orgId"`
}
+// GetHealthBadRequestResponseBody is the type of the "projects" service
+// "getHealth" endpoint HTTP response body for the "bad_request" error.
+type GetHealthBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthUnauthorizedResponseBody is the type of the "projects" service
+// "getHealth" endpoint HTTP response body for the "unauthorized" error.
+type GetHealthUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthForbiddenResponseBody is the type of the "projects" service
+// "getHealth" endpoint HTTP response body for the "forbidden" error.
+type GetHealthForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthNotFoundResponseBody is the type of the "projects" service
+// "getHealth" endpoint HTTP response body for the "not_found" error.
+type GetHealthNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthInternalErrorResponseBody is the type of the "projects" service
+// "getHealth" endpoint HTTP response body for the "internal_error" error.
+type GetHealthInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateProjectBadRequestResponseBody is the type of the "projects" service
+// "createProject" endpoint HTTP response body for the "bad_request" error.
+type CreateProjectBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateProjectUnauthorizedResponseBody is the type of the "projects" service
+// "createProject" endpoint HTTP response body for the "unauthorized" error.
+type CreateProjectUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateProjectForbiddenResponseBody is the type of the "projects" service
+// "createProject" endpoint HTTP response body for the "forbidden" error.
+type CreateProjectForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateProjectNotFoundResponseBody is the type of the "projects" service
+// "createProject" endpoint HTTP response body for the "not_found" error.
+type CreateProjectNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateProjectInternalErrorResponseBody is the type of the "projects" service
+// "createProject" endpoint HTTP response body for the "internal_error" error.
+type CreateProjectInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
// NewCreateProjectResponseBody builds the HTTP response body from the result
// of the "createProject" endpoint of the "projects" service.
func NewCreateProjectResponseBody(res *projectsviews.ProjectResultView) *CreateProjectResponseBody {
@@ -47,6 +177,126 @@ func NewCreateProjectResponseBody(res *projectsviews.ProjectResultView) *CreateP
return body
}
+// NewGetHealthBadRequestResponseBody builds the HTTP response body from the
+// result of the "getHealth" endpoint of the "projects" service.
+func NewGetHealthBadRequestResponseBody(res *projects.APIErrorResult) *GetHealthBadRequestResponseBody {
+ body := &GetHealthBadRequestResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetHealthUnauthorizedResponseBody builds the HTTP response body from the
+// result of the "getHealth" endpoint of the "projects" service.
+func NewGetHealthUnauthorizedResponseBody(res *projects.APIErrorResult) *GetHealthUnauthorizedResponseBody {
+ body := &GetHealthUnauthorizedResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetHealthForbiddenResponseBody builds the HTTP response body from the
+// result of the "getHealth" endpoint of the "projects" service.
+func NewGetHealthForbiddenResponseBody(res *projects.APIErrorResult) *GetHealthForbiddenResponseBody {
+ body := &GetHealthForbiddenResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetHealthNotFoundResponseBody builds the HTTP response body from the
+// result of the "getHealth" endpoint of the "projects" service.
+func NewGetHealthNotFoundResponseBody(res *projects.APIErrorResult) *GetHealthNotFoundResponseBody {
+ body := &GetHealthNotFoundResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetHealthInternalErrorResponseBody builds the HTTP response body from the
+// result of the "getHealth" endpoint of the "projects" service.
+func NewGetHealthInternalErrorResponseBody(res *projects.APIErrorResult) *GetHealthInternalErrorResponseBody {
+ body := &GetHealthInternalErrorResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewCreateProjectBadRequestResponseBody builds the HTTP response body from
+// the result of the "createProject" endpoint of the "projects" service.
+func NewCreateProjectBadRequestResponseBody(res *projects.APIErrorResult) *CreateProjectBadRequestResponseBody {
+ body := &CreateProjectBadRequestResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewCreateProjectUnauthorizedResponseBody builds the HTTP response body from
+// the result of the "createProject" endpoint of the "projects" service.
+func NewCreateProjectUnauthorizedResponseBody(res *projects.APIErrorResult) *CreateProjectUnauthorizedResponseBody {
+ body := &CreateProjectUnauthorizedResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewCreateProjectForbiddenResponseBody builds the HTTP response body from the
+// result of the "createProject" endpoint of the "projects" service.
+func NewCreateProjectForbiddenResponseBody(res *projects.APIErrorResult) *CreateProjectForbiddenResponseBody {
+ body := &CreateProjectForbiddenResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewCreateProjectNotFoundResponseBody builds the HTTP response body from the
+// result of the "createProject" endpoint of the "projects" service.
+func NewCreateProjectNotFoundResponseBody(res *projects.APIErrorResult) *CreateProjectNotFoundResponseBody {
+ body := &CreateProjectNotFoundResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewCreateProjectInternalErrorResponseBody builds the HTTP response body from
+// the result of the "createProject" endpoint of the "projects" service.
+func NewCreateProjectInternalErrorResponseBody(res *projects.APIErrorResult) *CreateProjectInternalErrorResponseBody {
+ body := &CreateProjectInternalErrorResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
// NewCreateProjectPayload builds a projects service createProject endpoint
// payload.
func NewCreateProjectPayload(body *CreateProjectRequestBody) *projects.CreateProjectPayload {
diff --git a/backend-go/internal/server/gen/http/secrets/client/cli.go b/backend-go/internal/server/gen/http/secrets/client/cli.go
index 6b10f8a139..8f592bcb80 100644
--- a/backend-go/internal/server/gen/http/secrets/client/cli.go
+++ b/backend-go/internal/server/gen/http/secrets/client/cli.go
@@ -23,7 +23,7 @@ func BuildCreateSecretPayload(secretsCreateSecretBody string) (*secrets.Secret,
{
err = json.Unmarshal([]byte(secretsCreateSecretBody), &body)
if err != nil {
- return nil, fmt.Errorf("invalid JSON for body, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"environment\": \"Qui eum quos eum pariatur.\",\n \"key\": \"DATABASE_URL\",\n \"projectId\": \"Deleniti itaque voluptatum.\",\n \"value\": \"Reiciendis minima.\"\n }'")
+ return nil, fmt.Errorf("invalid JSON for body, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"environment\": \"Omnis et non.\",\n \"key\": \"DATABASE_URL\",\n \"projectId\": \"Sed consequatur.\",\n \"value\": \"Earum sed blanditiis est dolor.\"\n }'")
}
}
v := &secrets.Secret{
@@ -57,7 +57,7 @@ func BuildUpdateSecretPayload(secretsUpdateSecretBody string, secretsUpdateSecre
{
err = json.Unmarshal([]byte(secretsUpdateSecretBody), &body)
if err != nil {
- return nil, fmt.Errorf("invalid JSON for body, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"key\": \"Omnis autem quo ducimus facilis veritatis.\",\n \"value\": \"Eligendi quasi iusto.\"\n }'")
+ return nil, fmt.Errorf("invalid JSON for body, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"key\": \"Omnis veniam.\",\n \"value\": \"Explicabo et sed.\"\n }'")
}
}
var id string
diff --git a/backend-go/internal/server/gen/http/secrets/client/encode_decode.go b/backend-go/internal/server/gen/http/secrets/client/encode_decode.go
index 7509ccfd8c..03ff0bec7b 100644
--- a/backend-go/internal/server/gen/http/secrets/client/encode_decode.go
+++ b/backend-go/internal/server/gen/http/secrets/client/encode_decode.go
@@ -38,6 +38,13 @@ func (c *Client) BuildGetHealthRequest(ctx context.Context, v any) (*http.Reques
// DecodeGetHealthResponse returns a decoder for responses returned by the
// secrets getHealth endpoint. restoreBody controls whether the response body
// should be restored after having been read.
+// DecodeGetHealthResponse may return the following errors:
+// - "bad_request" (type *secrets.APIErrorResult): http.StatusBadRequest
+// - "unauthorized" (type *secrets.APIErrorResult): http.StatusUnauthorized
+// - "forbidden" (type *secrets.APIErrorResult): http.StatusForbidden
+// - "not_found" (type *secrets.APIErrorResult): http.StatusNotFound
+// - "internal_error" (type *secrets.APIErrorResult): http.StatusInternalServerError
+// - error: internal error
func DecodeGetHealthResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) {
return func(resp *http.Response) (any, error) {
if restoreBody {
@@ -63,6 +70,76 @@ func DecodeGetHealthResponse(decoder func(*http.Response) goahttp.Decoder, resto
return nil, goahttp.ErrDecodingError("secrets", "getHealth", err)
}
return body, nil
+ case http.StatusBadRequest:
+ var (
+ body GetHealthBadRequestResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "getHealth", err)
+ }
+ err = ValidateGetHealthBadRequestResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "getHealth", err)
+ }
+ return nil, NewGetHealthBadRequest(&body)
+ case http.StatusUnauthorized:
+ var (
+ body GetHealthUnauthorizedResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "getHealth", err)
+ }
+ err = ValidateGetHealthUnauthorizedResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "getHealth", err)
+ }
+ return nil, NewGetHealthUnauthorized(&body)
+ case http.StatusForbidden:
+ var (
+ body GetHealthForbiddenResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "getHealth", err)
+ }
+ err = ValidateGetHealthForbiddenResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "getHealth", err)
+ }
+ return nil, NewGetHealthForbidden(&body)
+ case http.StatusNotFound:
+ var (
+ body GetHealthNotFoundResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "getHealth", err)
+ }
+ err = ValidateGetHealthNotFoundResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "getHealth", err)
+ }
+ return nil, NewGetHealthNotFound(&body)
+ case http.StatusInternalServerError:
+ var (
+ body GetHealthInternalErrorResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "getHealth", err)
+ }
+ err = ValidateGetHealthInternalErrorResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "getHealth", err)
+ }
+ return nil, NewGetHealthInternalError(&body)
default:
body, _ := io.ReadAll(resp.Body)
return nil, goahttp.ErrInvalidResponse("secrets", "getHealth", resp.StatusCode, string(body))
@@ -104,6 +181,13 @@ func EncodeCreateSecretRequest(encoder func(*http.Request) goahttp.Encoder) func
// DecodeCreateSecretResponse returns a decoder for responses returned by the
// secrets createSecret endpoint. restoreBody controls whether the response
// body should be restored after having been read.
+// DecodeCreateSecretResponse may return the following errors:
+// - "bad_request" (type *secrets.APIErrorResult): http.StatusBadRequest
+// - "unauthorized" (type *secrets.APIErrorResult): http.StatusUnauthorized
+// - "forbidden" (type *secrets.APIErrorResult): http.StatusForbidden
+// - "not_found" (type *secrets.APIErrorResult): http.StatusNotFound
+// - "internal_error" (type *secrets.APIErrorResult): http.StatusInternalServerError
+// - error: internal error
func DecodeCreateSecretResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) {
return func(resp *http.Response) (any, error) {
if restoreBody {
@@ -136,6 +220,76 @@ func DecodeCreateSecretResponse(decoder func(*http.Response) goahttp.Decoder, re
}
res := secrets.NewSecretResult(vres)
return res, nil
+ case http.StatusBadRequest:
+ var (
+ body CreateSecretBadRequestResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "createSecret", err)
+ }
+ err = ValidateCreateSecretBadRequestResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "createSecret", err)
+ }
+ return nil, NewCreateSecretBadRequest(&body)
+ case http.StatusUnauthorized:
+ var (
+ body CreateSecretUnauthorizedResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "createSecret", err)
+ }
+ err = ValidateCreateSecretUnauthorizedResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "createSecret", err)
+ }
+ return nil, NewCreateSecretUnauthorized(&body)
+ case http.StatusForbidden:
+ var (
+ body CreateSecretForbiddenResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "createSecret", err)
+ }
+ err = ValidateCreateSecretForbiddenResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "createSecret", err)
+ }
+ return nil, NewCreateSecretForbidden(&body)
+ case http.StatusNotFound:
+ var (
+ body CreateSecretNotFoundResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "createSecret", err)
+ }
+ err = ValidateCreateSecretNotFoundResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "createSecret", err)
+ }
+ return nil, NewCreateSecretNotFound(&body)
+ case http.StatusInternalServerError:
+ var (
+ body CreateSecretInternalErrorResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "createSecret", err)
+ }
+ err = ValidateCreateSecretInternalErrorResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "createSecret", err)
+ }
+ return nil, NewCreateSecretInternalError(&body)
default:
body, _ := io.ReadAll(resp.Body)
return nil, goahttp.ErrInvalidResponse("secrets", "createSecret", resp.StatusCode, string(body))
@@ -171,6 +325,13 @@ func (c *Client) BuildGetSecretRequest(ctx context.Context, v any) (*http.Reques
// DecodeGetSecretResponse returns a decoder for responses returned by the
// secrets getSecret endpoint. restoreBody controls whether the response body
// should be restored after having been read.
+// DecodeGetSecretResponse may return the following errors:
+// - "bad_request" (type *secrets.APIErrorResult): http.StatusBadRequest
+// - "unauthorized" (type *secrets.APIErrorResult): http.StatusUnauthorized
+// - "forbidden" (type *secrets.APIErrorResult): http.StatusForbidden
+// - "not_found" (type *secrets.APIErrorResult): http.StatusNotFound
+// - "internal_error" (type *secrets.APIErrorResult): http.StatusInternalServerError
+// - error: internal error
func DecodeGetSecretResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) {
return func(resp *http.Response) (any, error) {
if restoreBody {
@@ -203,6 +364,76 @@ func DecodeGetSecretResponse(decoder func(*http.Response) goahttp.Decoder, resto
}
res := secrets.NewSecretResult(vres)
return res, nil
+ case http.StatusBadRequest:
+ var (
+ body GetSecretBadRequestResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "getSecret", err)
+ }
+ err = ValidateGetSecretBadRequestResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "getSecret", err)
+ }
+ return nil, NewGetSecretBadRequest(&body)
+ case http.StatusUnauthorized:
+ var (
+ body GetSecretUnauthorizedResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "getSecret", err)
+ }
+ err = ValidateGetSecretUnauthorizedResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "getSecret", err)
+ }
+ return nil, NewGetSecretUnauthorized(&body)
+ case http.StatusForbidden:
+ var (
+ body GetSecretForbiddenResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "getSecret", err)
+ }
+ err = ValidateGetSecretForbiddenResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "getSecret", err)
+ }
+ return nil, NewGetSecretForbidden(&body)
+ case http.StatusNotFound:
+ var (
+ body GetSecretNotFoundResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "getSecret", err)
+ }
+ err = ValidateGetSecretNotFoundResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "getSecret", err)
+ }
+ return nil, NewGetSecretNotFound(&body)
+ case http.StatusInternalServerError:
+ var (
+ body GetSecretInternalErrorResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "getSecret", err)
+ }
+ err = ValidateGetSecretInternalErrorResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "getSecret", err)
+ }
+ return nil, NewGetSecretInternalError(&body)
default:
body, _ := io.ReadAll(resp.Body)
return nil, goahttp.ErrInvalidResponse("secrets", "getSecret", resp.StatusCode, string(body))
@@ -254,6 +485,13 @@ func EncodeUpdateSecretRequest(encoder func(*http.Request) goahttp.Encoder) func
// DecodeUpdateSecretResponse returns a decoder for responses returned by the
// secrets updateSecret endpoint. restoreBody controls whether the response
// body should be restored after having been read.
+// DecodeUpdateSecretResponse may return the following errors:
+// - "bad_request" (type *secrets.APIErrorResult): http.StatusBadRequest
+// - "unauthorized" (type *secrets.APIErrorResult): http.StatusUnauthorized
+// - "forbidden" (type *secrets.APIErrorResult): http.StatusForbidden
+// - "not_found" (type *secrets.APIErrorResult): http.StatusNotFound
+// - "internal_error" (type *secrets.APIErrorResult): http.StatusInternalServerError
+// - error: internal error
func DecodeUpdateSecretResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) {
return func(resp *http.Response) (any, error) {
if restoreBody {
@@ -286,6 +524,76 @@ func DecodeUpdateSecretResponse(decoder func(*http.Response) goahttp.Decoder, re
}
res := secrets.NewSecretResult(vres)
return res, nil
+ case http.StatusBadRequest:
+ var (
+ body UpdateSecretBadRequestResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "updateSecret", err)
+ }
+ err = ValidateUpdateSecretBadRequestResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "updateSecret", err)
+ }
+ return nil, NewUpdateSecretBadRequest(&body)
+ case http.StatusUnauthorized:
+ var (
+ body UpdateSecretUnauthorizedResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "updateSecret", err)
+ }
+ err = ValidateUpdateSecretUnauthorizedResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "updateSecret", err)
+ }
+ return nil, NewUpdateSecretUnauthorized(&body)
+ case http.StatusForbidden:
+ var (
+ body UpdateSecretForbiddenResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "updateSecret", err)
+ }
+ err = ValidateUpdateSecretForbiddenResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "updateSecret", err)
+ }
+ return nil, NewUpdateSecretForbidden(&body)
+ case http.StatusNotFound:
+ var (
+ body UpdateSecretNotFoundResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "updateSecret", err)
+ }
+ err = ValidateUpdateSecretNotFoundResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "updateSecret", err)
+ }
+ return nil, NewUpdateSecretNotFound(&body)
+ case http.StatusInternalServerError:
+ var (
+ body UpdateSecretInternalErrorResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "updateSecret", err)
+ }
+ err = ValidateUpdateSecretInternalErrorResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "updateSecret", err)
+ }
+ return nil, NewUpdateSecretInternalError(&body)
default:
body, _ := io.ReadAll(resp.Body)
return nil, goahttp.ErrInvalidResponse("secrets", "updateSecret", resp.StatusCode, string(body))
@@ -321,6 +629,13 @@ func (c *Client) BuildDeleteSecretRequest(ctx context.Context, v any) (*http.Req
// DecodeDeleteSecretResponse returns a decoder for responses returned by the
// secrets deleteSecret endpoint. restoreBody controls whether the response
// body should be restored after having been read.
+// DecodeDeleteSecretResponse may return the following errors:
+// - "bad_request" (type *secrets.APIErrorResult): http.StatusBadRequest
+// - "unauthorized" (type *secrets.APIErrorResult): http.StatusUnauthorized
+// - "forbidden" (type *secrets.APIErrorResult): http.StatusForbidden
+// - "not_found" (type *secrets.APIErrorResult): http.StatusNotFound
+// - "internal_error" (type *secrets.APIErrorResult): http.StatusInternalServerError
+// - error: internal error
func DecodeDeleteSecretResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) {
return func(resp *http.Response) (any, error) {
if restoreBody {
@@ -338,6 +653,76 @@ func DecodeDeleteSecretResponse(decoder func(*http.Response) goahttp.Decoder, re
switch resp.StatusCode {
case http.StatusNoContent:
return nil, nil
+ case http.StatusBadRequest:
+ var (
+ body DeleteSecretBadRequestResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "deleteSecret", err)
+ }
+ err = ValidateDeleteSecretBadRequestResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "deleteSecret", err)
+ }
+ return nil, NewDeleteSecretBadRequest(&body)
+ case http.StatusUnauthorized:
+ var (
+ body DeleteSecretUnauthorizedResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "deleteSecret", err)
+ }
+ err = ValidateDeleteSecretUnauthorizedResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "deleteSecret", err)
+ }
+ return nil, NewDeleteSecretUnauthorized(&body)
+ case http.StatusForbidden:
+ var (
+ body DeleteSecretForbiddenResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "deleteSecret", err)
+ }
+ err = ValidateDeleteSecretForbiddenResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "deleteSecret", err)
+ }
+ return nil, NewDeleteSecretForbidden(&body)
+ case http.StatusNotFound:
+ var (
+ body DeleteSecretNotFoundResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "deleteSecret", err)
+ }
+ err = ValidateDeleteSecretNotFoundResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "deleteSecret", err)
+ }
+ return nil, NewDeleteSecretNotFound(&body)
+ case http.StatusInternalServerError:
+ var (
+ body DeleteSecretInternalErrorResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "deleteSecret", err)
+ }
+ err = ValidateDeleteSecretInternalErrorResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "deleteSecret", err)
+ }
+ return nil, NewDeleteSecretInternalError(&body)
default:
body, _ := io.ReadAll(resp.Body)
return nil, goahttp.ErrInvalidResponse("secrets", "deleteSecret", resp.StatusCode, string(body))
@@ -379,6 +764,13 @@ func EncodeListSecretsRequest(encoder func(*http.Request) goahttp.Encoder) func(
// DecodeListSecretsResponse returns a decoder for responses returned by the
// secrets listSecrets endpoint. restoreBody controls whether the response body
// should be restored after having been read.
+// DecodeListSecretsResponse may return the following errors:
+// - "bad_request" (type *secrets.APIErrorResult): http.StatusBadRequest
+// - "unauthorized" (type *secrets.APIErrorResult): http.StatusUnauthorized
+// - "forbidden" (type *secrets.APIErrorResult): http.StatusForbidden
+// - "not_found" (type *secrets.APIErrorResult): http.StatusNotFound
+// - "internal_error" (type *secrets.APIErrorResult): http.StatusInternalServerError
+// - error: internal error
func DecodeListSecretsResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) {
return func(resp *http.Response) (any, error) {
if restoreBody {
@@ -411,6 +803,76 @@ func DecodeListSecretsResponse(decoder func(*http.Response) goahttp.Decoder, res
}
res := secrets.NewSecretResultCollection(vres)
return res, nil
+ case http.StatusBadRequest:
+ var (
+ body ListSecretsBadRequestResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "listSecrets", err)
+ }
+ err = ValidateListSecretsBadRequestResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "listSecrets", err)
+ }
+ return nil, NewListSecretsBadRequest(&body)
+ case http.StatusUnauthorized:
+ var (
+ body ListSecretsUnauthorizedResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "listSecrets", err)
+ }
+ err = ValidateListSecretsUnauthorizedResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "listSecrets", err)
+ }
+ return nil, NewListSecretsUnauthorized(&body)
+ case http.StatusForbidden:
+ var (
+ body ListSecretsForbiddenResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "listSecrets", err)
+ }
+ err = ValidateListSecretsForbiddenResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "listSecrets", err)
+ }
+ return nil, NewListSecretsForbidden(&body)
+ case http.StatusNotFound:
+ var (
+ body ListSecretsNotFoundResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "listSecrets", err)
+ }
+ err = ValidateListSecretsNotFoundResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "listSecrets", err)
+ }
+ return nil, NewListSecretsNotFound(&body)
+ case http.StatusInternalServerError:
+ var (
+ body ListSecretsInternalErrorResponseBody
+ err error
+ )
+ err = decoder(resp).Decode(&body)
+ if err != nil {
+ return nil, goahttp.ErrDecodingError("secrets", "listSecrets", err)
+ }
+ err = ValidateListSecretsInternalErrorResponseBody(&body)
+ if err != nil {
+ return nil, goahttp.ErrValidationError("secrets", "listSecrets", err)
+ }
+ return nil, NewListSecretsInternalError(&body)
default:
body, _ := io.ReadAll(resp.Body)
return nil, goahttp.ErrInvalidResponse("secrets", "listSecrets", resp.StatusCode, string(body))
diff --git a/backend-go/internal/server/gen/http/secrets/client/types.go b/backend-go/internal/server/gen/http/secrets/client/types.go
index 14436983ca..793ae358f1 100644
--- a/backend-go/internal/server/gen/http/secrets/client/types.go
+++ b/backend-go/internal/server/gen/http/secrets/client/types.go
@@ -85,6 +85,396 @@ type UpdateSecretResponseBody struct {
// endpoint HTTP response body.
type ListSecretsResponseBody []*SecretResultResponse
+// GetHealthBadRequestResponseBody is the type of the "secrets" service
+// "getHealth" endpoint HTTP response body for the "bad_request" error.
+type GetHealthBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthUnauthorizedResponseBody is the type of the "secrets" service
+// "getHealth" endpoint HTTP response body for the "unauthorized" error.
+type GetHealthUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthForbiddenResponseBody is the type of the "secrets" service
+// "getHealth" endpoint HTTP response body for the "forbidden" error.
+type GetHealthForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthNotFoundResponseBody is the type of the "secrets" service
+// "getHealth" endpoint HTTP response body for the "not_found" error.
+type GetHealthNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthInternalErrorResponseBody is the type of the "secrets" service
+// "getHealth" endpoint HTTP response body for the "internal_error" error.
+type GetHealthInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateSecretBadRequestResponseBody is the type of the "secrets" service
+// "createSecret" endpoint HTTP response body for the "bad_request" error.
+type CreateSecretBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateSecretUnauthorizedResponseBody is the type of the "secrets" service
+// "createSecret" endpoint HTTP response body for the "unauthorized" error.
+type CreateSecretUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateSecretForbiddenResponseBody is the type of the "secrets" service
+// "createSecret" endpoint HTTP response body for the "forbidden" error.
+type CreateSecretForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateSecretNotFoundResponseBody is the type of the "secrets" service
+// "createSecret" endpoint HTTP response body for the "not_found" error.
+type CreateSecretNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateSecretInternalErrorResponseBody is the type of the "secrets" service
+// "createSecret" endpoint HTTP response body for the "internal_error" error.
+type CreateSecretInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetSecretBadRequestResponseBody is the type of the "secrets" service
+// "getSecret" endpoint HTTP response body for the "bad_request" error.
+type GetSecretBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetSecretUnauthorizedResponseBody is the type of the "secrets" service
+// "getSecret" endpoint HTTP response body for the "unauthorized" error.
+type GetSecretUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetSecretForbiddenResponseBody is the type of the "secrets" service
+// "getSecret" endpoint HTTP response body for the "forbidden" error.
+type GetSecretForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetSecretNotFoundResponseBody is the type of the "secrets" service
+// "getSecret" endpoint HTTP response body for the "not_found" error.
+type GetSecretNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetSecretInternalErrorResponseBody is the type of the "secrets" service
+// "getSecret" endpoint HTTP response body for the "internal_error" error.
+type GetSecretInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// UpdateSecretBadRequestResponseBody is the type of the "secrets" service
+// "updateSecret" endpoint HTTP response body for the "bad_request" error.
+type UpdateSecretBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// UpdateSecretUnauthorizedResponseBody is the type of the "secrets" service
+// "updateSecret" endpoint HTTP response body for the "unauthorized" error.
+type UpdateSecretUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// UpdateSecretForbiddenResponseBody is the type of the "secrets" service
+// "updateSecret" endpoint HTTP response body for the "forbidden" error.
+type UpdateSecretForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// UpdateSecretNotFoundResponseBody is the type of the "secrets" service
+// "updateSecret" endpoint HTTP response body for the "not_found" error.
+type UpdateSecretNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// UpdateSecretInternalErrorResponseBody is the type of the "secrets" service
+// "updateSecret" endpoint HTTP response body for the "internal_error" error.
+type UpdateSecretInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// DeleteSecretBadRequestResponseBody is the type of the "secrets" service
+// "deleteSecret" endpoint HTTP response body for the "bad_request" error.
+type DeleteSecretBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// DeleteSecretUnauthorizedResponseBody is the type of the "secrets" service
+// "deleteSecret" endpoint HTTP response body for the "unauthorized" error.
+type DeleteSecretUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// DeleteSecretForbiddenResponseBody is the type of the "secrets" service
+// "deleteSecret" endpoint HTTP response body for the "forbidden" error.
+type DeleteSecretForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// DeleteSecretNotFoundResponseBody is the type of the "secrets" service
+// "deleteSecret" endpoint HTTP response body for the "not_found" error.
+type DeleteSecretNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// DeleteSecretInternalErrorResponseBody is the type of the "secrets" service
+// "deleteSecret" endpoint HTTP response body for the "internal_error" error.
+type DeleteSecretInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// ListSecretsBadRequestResponseBody is the type of the "secrets" service
+// "listSecrets" endpoint HTTP response body for the "bad_request" error.
+type ListSecretsBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// ListSecretsUnauthorizedResponseBody is the type of the "secrets" service
+// "listSecrets" endpoint HTTP response body for the "unauthorized" error.
+type ListSecretsUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// ListSecretsForbiddenResponseBody is the type of the "secrets" service
+// "listSecrets" endpoint HTTP response body for the "forbidden" error.
+type ListSecretsForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// ListSecretsNotFoundResponseBody is the type of the "secrets" service
+// "listSecrets" endpoint HTTP response body for the "not_found" error.
+type ListSecretsNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// ListSecretsInternalErrorResponseBody is the type of the "secrets" service
+// "listSecrets" endpoint HTTP response body for the "internal_error" error.
+type ListSecretsInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode *int `form:"statusCode,omitempty" json:"statusCode,omitempty" xml:"statusCode,omitempty"`
+ // Human-readable error message
+ Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
+ // Error class name
+ ErrorClass *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
// SecretResultResponse is used to define fields on response body types.
type SecretResultResponse struct {
// Secret ID
@@ -121,6 +511,71 @@ func NewUpdateSecretRequestBody(p *secrets.UpdateSecretPayload) *UpdateSecretReq
return body
}
+// NewGetHealthBadRequest builds a secrets service getHealth endpoint
+// bad_request error.
+func NewGetHealthBadRequest(body *GetHealthBadRequestResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewGetHealthUnauthorized builds a secrets service getHealth endpoint
+// unauthorized error.
+func NewGetHealthUnauthorized(body *GetHealthUnauthorizedResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewGetHealthForbidden builds a secrets service getHealth endpoint forbidden
+// error.
+func NewGetHealthForbidden(body *GetHealthForbiddenResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewGetHealthNotFound builds a secrets service getHealth endpoint not_found
+// error.
+func NewGetHealthNotFound(body *GetHealthNotFoundResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewGetHealthInternalError builds a secrets service getHealth endpoint
+// internal_error error.
+func NewGetHealthInternalError(body *GetHealthInternalErrorResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
// NewCreateSecretSecretResultCreated builds a "secrets" service "createSecret"
// endpoint result from a HTTP "Created" response.
func NewCreateSecretSecretResultCreated(body *CreateSecretResponseBody) *secretsviews.SecretResultView {
@@ -135,6 +590,71 @@ func NewCreateSecretSecretResultCreated(body *CreateSecretResponseBody) *secrets
return v
}
+// NewCreateSecretBadRequest builds a secrets service createSecret endpoint
+// bad_request error.
+func NewCreateSecretBadRequest(body *CreateSecretBadRequestResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewCreateSecretUnauthorized builds a secrets service createSecret endpoint
+// unauthorized error.
+func NewCreateSecretUnauthorized(body *CreateSecretUnauthorizedResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewCreateSecretForbidden builds a secrets service createSecret endpoint
+// forbidden error.
+func NewCreateSecretForbidden(body *CreateSecretForbiddenResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewCreateSecretNotFound builds a secrets service createSecret endpoint
+// not_found error.
+func NewCreateSecretNotFound(body *CreateSecretNotFoundResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewCreateSecretInternalError builds a secrets service createSecret endpoint
+// internal_error error.
+func NewCreateSecretInternalError(body *CreateSecretInternalErrorResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
// NewGetSecretSecretResultOK builds a "secrets" service "getSecret" endpoint
// result from a HTTP "OK" response.
func NewGetSecretSecretResultOK(body *GetSecretResponseBody) *secretsviews.SecretResultView {
@@ -149,6 +669,71 @@ func NewGetSecretSecretResultOK(body *GetSecretResponseBody) *secretsviews.Secre
return v
}
+// NewGetSecretBadRequest builds a secrets service getSecret endpoint
+// bad_request error.
+func NewGetSecretBadRequest(body *GetSecretBadRequestResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewGetSecretUnauthorized builds a secrets service getSecret endpoint
+// unauthorized error.
+func NewGetSecretUnauthorized(body *GetSecretUnauthorizedResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewGetSecretForbidden builds a secrets service getSecret endpoint forbidden
+// error.
+func NewGetSecretForbidden(body *GetSecretForbiddenResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewGetSecretNotFound builds a secrets service getSecret endpoint not_found
+// error.
+func NewGetSecretNotFound(body *GetSecretNotFoundResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewGetSecretInternalError builds a secrets service getSecret endpoint
+// internal_error error.
+func NewGetSecretInternalError(body *GetSecretInternalErrorResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
// NewUpdateSecretSecretResultOK builds a "secrets" service "updateSecret"
// endpoint result from a HTTP "OK" response.
func NewUpdateSecretSecretResultOK(body *UpdateSecretResponseBody) *secretsviews.SecretResultView {
@@ -163,6 +748,136 @@ func NewUpdateSecretSecretResultOK(body *UpdateSecretResponseBody) *secretsviews
return v
}
+// NewUpdateSecretBadRequest builds a secrets service updateSecret endpoint
+// bad_request error.
+func NewUpdateSecretBadRequest(body *UpdateSecretBadRequestResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewUpdateSecretUnauthorized builds a secrets service updateSecret endpoint
+// unauthorized error.
+func NewUpdateSecretUnauthorized(body *UpdateSecretUnauthorizedResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewUpdateSecretForbidden builds a secrets service updateSecret endpoint
+// forbidden error.
+func NewUpdateSecretForbidden(body *UpdateSecretForbiddenResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewUpdateSecretNotFound builds a secrets service updateSecret endpoint
+// not_found error.
+func NewUpdateSecretNotFound(body *UpdateSecretNotFoundResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewUpdateSecretInternalError builds a secrets service updateSecret endpoint
+// internal_error error.
+func NewUpdateSecretInternalError(body *UpdateSecretInternalErrorResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewDeleteSecretBadRequest builds a secrets service deleteSecret endpoint
+// bad_request error.
+func NewDeleteSecretBadRequest(body *DeleteSecretBadRequestResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewDeleteSecretUnauthorized builds a secrets service deleteSecret endpoint
+// unauthorized error.
+func NewDeleteSecretUnauthorized(body *DeleteSecretUnauthorizedResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewDeleteSecretForbidden builds a secrets service deleteSecret endpoint
+// forbidden error.
+func NewDeleteSecretForbidden(body *DeleteSecretForbiddenResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewDeleteSecretNotFound builds a secrets service deleteSecret endpoint
+// not_found error.
+func NewDeleteSecretNotFound(body *DeleteSecretNotFoundResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewDeleteSecretInternalError builds a secrets service deleteSecret endpoint
+// internal_error error.
+func NewDeleteSecretInternalError(body *DeleteSecretInternalErrorResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
// NewListSecretsSecretResultCollectionOK builds a "secrets" service
// "listSecrets" endpoint result from a HTTP "OK" response.
func NewListSecretsSecretResultCollectionOK(body ListSecretsResponseBody) secretsviews.SecretResultCollectionView {
@@ -178,6 +893,521 @@ func NewListSecretsSecretResultCollectionOK(body ListSecretsResponseBody) secret
return v
}
+// NewListSecretsBadRequest builds a secrets service listSecrets endpoint
+// bad_request error.
+func NewListSecretsBadRequest(body *ListSecretsBadRequestResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewListSecretsUnauthorized builds a secrets service listSecrets endpoint
+// unauthorized error.
+func NewListSecretsUnauthorized(body *ListSecretsUnauthorizedResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewListSecretsForbidden builds a secrets service listSecrets endpoint
+// forbidden error.
+func NewListSecretsForbidden(body *ListSecretsForbiddenResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewListSecretsNotFound builds a secrets service listSecrets endpoint
+// not_found error.
+func NewListSecretsNotFound(body *ListSecretsNotFoundResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// NewListSecretsInternalError builds a secrets service listSecrets endpoint
+// internal_error error.
+func NewListSecretsInternalError(body *ListSecretsInternalErrorResponseBody) *secrets.APIErrorResult {
+ v := &secrets.APIErrorResult{
+ StatusCode: *body.StatusCode,
+ Message: *body.Message,
+ ErrorClass: *body.ErrorClass,
+ Details: body.Details,
+ }
+
+ return v
+}
+
+// ValidateGetHealthBadRequestResponseBody runs the validations defined on
+// getHealth_bad_request_response_body
+func ValidateGetHealthBadRequestResponseBody(body *GetHealthBadRequestResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetHealthUnauthorizedResponseBody runs the validations defined on
+// getHealth_unauthorized_response_body
+func ValidateGetHealthUnauthorizedResponseBody(body *GetHealthUnauthorizedResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetHealthForbiddenResponseBody runs the validations defined on
+// getHealth_forbidden_response_body
+func ValidateGetHealthForbiddenResponseBody(body *GetHealthForbiddenResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetHealthNotFoundResponseBody runs the validations defined on
+// getHealth_not_found_response_body
+func ValidateGetHealthNotFoundResponseBody(body *GetHealthNotFoundResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetHealthInternalErrorResponseBody runs the validations defined on
+// getHealth_internal_error_response_body
+func ValidateGetHealthInternalErrorResponseBody(body *GetHealthInternalErrorResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateCreateSecretBadRequestResponseBody runs the validations defined on
+// createSecret_bad_request_response_body
+func ValidateCreateSecretBadRequestResponseBody(body *CreateSecretBadRequestResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateCreateSecretUnauthorizedResponseBody runs the validations defined on
+// createSecret_unauthorized_response_body
+func ValidateCreateSecretUnauthorizedResponseBody(body *CreateSecretUnauthorizedResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateCreateSecretForbiddenResponseBody runs the validations defined on
+// createSecret_forbidden_response_body
+func ValidateCreateSecretForbiddenResponseBody(body *CreateSecretForbiddenResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateCreateSecretNotFoundResponseBody runs the validations defined on
+// createSecret_not_found_response_body
+func ValidateCreateSecretNotFoundResponseBody(body *CreateSecretNotFoundResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateCreateSecretInternalErrorResponseBody runs the validations defined
+// on createSecret_internal_error_response_body
+func ValidateCreateSecretInternalErrorResponseBody(body *CreateSecretInternalErrorResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetSecretBadRequestResponseBody runs the validations defined on
+// getSecret_bad_request_response_body
+func ValidateGetSecretBadRequestResponseBody(body *GetSecretBadRequestResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetSecretUnauthorizedResponseBody runs the validations defined on
+// getSecret_unauthorized_response_body
+func ValidateGetSecretUnauthorizedResponseBody(body *GetSecretUnauthorizedResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetSecretForbiddenResponseBody runs the validations defined on
+// getSecret_forbidden_response_body
+func ValidateGetSecretForbiddenResponseBody(body *GetSecretForbiddenResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetSecretNotFoundResponseBody runs the validations defined on
+// getSecret_not_found_response_body
+func ValidateGetSecretNotFoundResponseBody(body *GetSecretNotFoundResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateGetSecretInternalErrorResponseBody runs the validations defined on
+// getSecret_internal_error_response_body
+func ValidateGetSecretInternalErrorResponseBody(body *GetSecretInternalErrorResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateUpdateSecretBadRequestResponseBody runs the validations defined on
+// updateSecret_bad_request_response_body
+func ValidateUpdateSecretBadRequestResponseBody(body *UpdateSecretBadRequestResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateUpdateSecretUnauthorizedResponseBody runs the validations defined on
+// updateSecret_unauthorized_response_body
+func ValidateUpdateSecretUnauthorizedResponseBody(body *UpdateSecretUnauthorizedResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateUpdateSecretForbiddenResponseBody runs the validations defined on
+// updateSecret_forbidden_response_body
+func ValidateUpdateSecretForbiddenResponseBody(body *UpdateSecretForbiddenResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateUpdateSecretNotFoundResponseBody runs the validations defined on
+// updateSecret_not_found_response_body
+func ValidateUpdateSecretNotFoundResponseBody(body *UpdateSecretNotFoundResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateUpdateSecretInternalErrorResponseBody runs the validations defined
+// on updateSecret_internal_error_response_body
+func ValidateUpdateSecretInternalErrorResponseBody(body *UpdateSecretInternalErrorResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateDeleteSecretBadRequestResponseBody runs the validations defined on
+// deleteSecret_bad_request_response_body
+func ValidateDeleteSecretBadRequestResponseBody(body *DeleteSecretBadRequestResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateDeleteSecretUnauthorizedResponseBody runs the validations defined on
+// deleteSecret_unauthorized_response_body
+func ValidateDeleteSecretUnauthorizedResponseBody(body *DeleteSecretUnauthorizedResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateDeleteSecretForbiddenResponseBody runs the validations defined on
+// deleteSecret_forbidden_response_body
+func ValidateDeleteSecretForbiddenResponseBody(body *DeleteSecretForbiddenResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateDeleteSecretNotFoundResponseBody runs the validations defined on
+// deleteSecret_not_found_response_body
+func ValidateDeleteSecretNotFoundResponseBody(body *DeleteSecretNotFoundResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateDeleteSecretInternalErrorResponseBody runs the validations defined
+// on deleteSecret_internal_error_response_body
+func ValidateDeleteSecretInternalErrorResponseBody(body *DeleteSecretInternalErrorResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateListSecretsBadRequestResponseBody runs the validations defined on
+// listSecrets_bad_request_response_body
+func ValidateListSecretsBadRequestResponseBody(body *ListSecretsBadRequestResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateListSecretsUnauthorizedResponseBody runs the validations defined on
+// listSecrets_unauthorized_response_body
+func ValidateListSecretsUnauthorizedResponseBody(body *ListSecretsUnauthorizedResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateListSecretsForbiddenResponseBody runs the validations defined on
+// listSecrets_forbidden_response_body
+func ValidateListSecretsForbiddenResponseBody(body *ListSecretsForbiddenResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateListSecretsNotFoundResponseBody runs the validations defined on
+// listSecrets_not_found_response_body
+func ValidateListSecretsNotFoundResponseBody(body *ListSecretsNotFoundResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
+// ValidateListSecretsInternalErrorResponseBody runs the validations defined on
+// listSecrets_internal_error_response_body
+func ValidateListSecretsInternalErrorResponseBody(body *ListSecretsInternalErrorResponseBody) (err error) {
+ if body.StatusCode == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("statusCode", "body"))
+ }
+ if body.Message == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("message", "body"))
+ }
+ if body.ErrorClass == nil {
+ err = goa.MergeErrors(err, goa.MissingFieldError("error", "body"))
+ }
+ return
+}
+
// ValidateSecretResultResponse runs the validations defined on
// SecretResultResponse
func ValidateSecretResultResponse(body *SecretResultResponse) (err error) {
diff --git a/backend-go/internal/server/gen/http/secrets/server/encode_decode.go b/backend-go/internal/server/gen/http/secrets/server/encode_decode.go
index 40f0e0fc2c..eac9c57ec4 100644
--- a/backend-go/internal/server/gen/http/secrets/server/encode_decode.go
+++ b/backend-go/internal/server/gen/http/secrets/server/encode_decode.go
@@ -32,6 +32,87 @@ func EncodeGetHealthResponse(encoder func(context.Context, http.ResponseWriter)
}
}
+// EncodeGetHealthError returns an encoder for errors returned by the getHealth
+// secrets endpoint.
+func EncodeGetHealthError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
+ encodeError := goahttp.ErrorEncoder(encoder, formatter)
+ return func(ctx context.Context, w http.ResponseWriter, v error) error {
+ var en goa.GoaErrorNamer
+ if !errors.As(v, &en) {
+ return encodeError(ctx, w, v)
+ }
+ switch en.GoaErrorName() {
+ case "bad_request":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetHealthBadRequestResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusBadRequest)
+ return enc.Encode(body)
+ case "unauthorized":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetHealthUnauthorizedResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusUnauthorized)
+ return enc.Encode(body)
+ case "forbidden":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetHealthForbiddenResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusForbidden)
+ return enc.Encode(body)
+ case "not_found":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetHealthNotFoundResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusNotFound)
+ return enc.Encode(body)
+ case "internal_error":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetHealthInternalErrorResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusInternalServerError)
+ return enc.Encode(body)
+ default:
+ return encodeError(ctx, w, v)
+ }
+ }
+}
+
// EncodeCreateSecretResponse returns an encoder for responses returned by the
// secrets createSecret endpoint.
func EncodeCreateSecretResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error {
@@ -74,6 +155,87 @@ func DecodeCreateSecretRequest(mux goahttp.Muxer, decoder func(*http.Request) go
}
}
+// EncodeCreateSecretError returns an encoder for errors returned by the
+// createSecret secrets endpoint.
+func EncodeCreateSecretError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
+ encodeError := goahttp.ErrorEncoder(encoder, formatter)
+ return func(ctx context.Context, w http.ResponseWriter, v error) error {
+ var en goa.GoaErrorNamer
+ if !errors.As(v, &en) {
+ return encodeError(ctx, w, v)
+ }
+ switch en.GoaErrorName() {
+ case "bad_request":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewCreateSecretBadRequestResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusBadRequest)
+ return enc.Encode(body)
+ case "unauthorized":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewCreateSecretUnauthorizedResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusUnauthorized)
+ return enc.Encode(body)
+ case "forbidden":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewCreateSecretForbiddenResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusForbidden)
+ return enc.Encode(body)
+ case "not_found":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewCreateSecretNotFoundResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusNotFound)
+ return enc.Encode(body)
+ case "internal_error":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewCreateSecretInternalErrorResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusInternalServerError)
+ return enc.Encode(body)
+ default:
+ return encodeError(ctx, w, v)
+ }
+ }
+}
+
// EncodeGetSecretResponse returns an encoder for responses returned by the
// secrets getSecret endpoint.
func EncodeGetSecretResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error {
@@ -103,6 +265,87 @@ func DecodeGetSecretRequest(mux goahttp.Muxer, decoder func(*http.Request) goaht
}
}
+// EncodeGetSecretError returns an encoder for errors returned by the getSecret
+// secrets endpoint.
+func EncodeGetSecretError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
+ encodeError := goahttp.ErrorEncoder(encoder, formatter)
+ return func(ctx context.Context, w http.ResponseWriter, v error) error {
+ var en goa.GoaErrorNamer
+ if !errors.As(v, &en) {
+ return encodeError(ctx, w, v)
+ }
+ switch en.GoaErrorName() {
+ case "bad_request":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetSecretBadRequestResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusBadRequest)
+ return enc.Encode(body)
+ case "unauthorized":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetSecretUnauthorizedResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusUnauthorized)
+ return enc.Encode(body)
+ case "forbidden":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetSecretForbiddenResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusForbidden)
+ return enc.Encode(body)
+ case "not_found":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetSecretNotFoundResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusNotFound)
+ return enc.Encode(body)
+ case "internal_error":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewGetSecretInternalErrorResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusInternalServerError)
+ return enc.Encode(body)
+ default:
+ return encodeError(ctx, w, v)
+ }
+ }
+}
+
// EncodeUpdateSecretResponse returns an encoder for responses returned by the
// secrets updateSecret endpoint.
func EncodeUpdateSecretResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error {
@@ -148,6 +391,87 @@ func DecodeUpdateSecretRequest(mux goahttp.Muxer, decoder func(*http.Request) go
}
}
+// EncodeUpdateSecretError returns an encoder for errors returned by the
+// updateSecret secrets endpoint.
+func EncodeUpdateSecretError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
+ encodeError := goahttp.ErrorEncoder(encoder, formatter)
+ return func(ctx context.Context, w http.ResponseWriter, v error) error {
+ var en goa.GoaErrorNamer
+ if !errors.As(v, &en) {
+ return encodeError(ctx, w, v)
+ }
+ switch en.GoaErrorName() {
+ case "bad_request":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewUpdateSecretBadRequestResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusBadRequest)
+ return enc.Encode(body)
+ case "unauthorized":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewUpdateSecretUnauthorizedResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusUnauthorized)
+ return enc.Encode(body)
+ case "forbidden":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewUpdateSecretForbiddenResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusForbidden)
+ return enc.Encode(body)
+ case "not_found":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewUpdateSecretNotFoundResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusNotFound)
+ return enc.Encode(body)
+ case "internal_error":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewUpdateSecretInternalErrorResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusInternalServerError)
+ return enc.Encode(body)
+ default:
+ return encodeError(ctx, w, v)
+ }
+ }
+}
+
// EncodeDeleteSecretResponse returns an encoder for responses returned by the
// secrets deleteSecret endpoint.
func EncodeDeleteSecretResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error {
@@ -174,6 +498,87 @@ func DecodeDeleteSecretRequest(mux goahttp.Muxer, decoder func(*http.Request) go
}
}
+// EncodeDeleteSecretError returns an encoder for errors returned by the
+// deleteSecret secrets endpoint.
+func EncodeDeleteSecretError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
+ encodeError := goahttp.ErrorEncoder(encoder, formatter)
+ return func(ctx context.Context, w http.ResponseWriter, v error) error {
+ var en goa.GoaErrorNamer
+ if !errors.As(v, &en) {
+ return encodeError(ctx, w, v)
+ }
+ switch en.GoaErrorName() {
+ case "bad_request":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewDeleteSecretBadRequestResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusBadRequest)
+ return enc.Encode(body)
+ case "unauthorized":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewDeleteSecretUnauthorizedResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusUnauthorized)
+ return enc.Encode(body)
+ case "forbidden":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewDeleteSecretForbiddenResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusForbidden)
+ return enc.Encode(body)
+ case "not_found":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewDeleteSecretNotFoundResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusNotFound)
+ return enc.Encode(body)
+ case "internal_error":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewDeleteSecretInternalErrorResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusInternalServerError)
+ return enc.Encode(body)
+ default:
+ return encodeError(ctx, w, v)
+ }
+ }
+}
+
// EncodeListSecretsResponse returns an encoder for responses returned by the
// secrets listSecrets endpoint.
func EncodeListSecretsResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error {
@@ -214,6 +619,87 @@ func DecodeListSecretsRequest(mux goahttp.Muxer, decoder func(*http.Request) goa
}
}
+// EncodeListSecretsError returns an encoder for errors returned by the
+// listSecrets secrets endpoint.
+func EncodeListSecretsError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
+ encodeError := goahttp.ErrorEncoder(encoder, formatter)
+ return func(ctx context.Context, w http.ResponseWriter, v error) error {
+ var en goa.GoaErrorNamer
+ if !errors.As(v, &en) {
+ return encodeError(ctx, w, v)
+ }
+ switch en.GoaErrorName() {
+ case "bad_request":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewListSecretsBadRequestResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusBadRequest)
+ return enc.Encode(body)
+ case "unauthorized":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewListSecretsUnauthorizedResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusUnauthorized)
+ return enc.Encode(body)
+ case "forbidden":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewListSecretsForbiddenResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusForbidden)
+ return enc.Encode(body)
+ case "not_found":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewListSecretsNotFoundResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusNotFound)
+ return enc.Encode(body)
+ case "internal_error":
+ var res *secrets.APIErrorResult
+ errors.As(v, &res)
+ enc := encoder(ctx, w)
+ var body any
+ if formatter != nil {
+ body = formatter(ctx, res)
+ } else {
+ body = NewListSecretsInternalErrorResponseBody(res)
+ }
+ w.Header().Set("goa-error", res.GoaErrorName())
+ w.WriteHeader(http.StatusInternalServerError)
+ return enc.Encode(body)
+ default:
+ return encodeError(ctx, w, v)
+ }
+ }
+}
+
// marshalSecretsviewsSecretResultViewToSecretResultResponse builds a value of
// type *SecretResultResponse from a value of type
// *secretsviews.SecretResultView.
diff --git a/backend-go/internal/server/gen/http/secrets/server/server.go b/backend-go/internal/server/gen/http/secrets/server/server.go
index 5284424c05..bb5f31675a 100644
--- a/backend-go/internal/server/gen/http/secrets/server/server.go
+++ b/backend-go/internal/server/gen/http/secrets/server/server.go
@@ -126,7 +126,7 @@ func NewGetHealthHandler(
) http.Handler {
var (
encodeResponse = EncodeGetHealthResponse(encoder)
- encodeError = goahttp.ErrorEncoder(encoder, formatter)
+ encodeError = EncodeGetHealthError(encoder, formatter)
)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept"))
@@ -173,7 +173,7 @@ func NewCreateSecretHandler(
var (
decodeRequest = DecodeCreateSecretRequest(mux, decoder)
encodeResponse = EncodeCreateSecretResponse(encoder)
- encodeError = goahttp.ErrorEncoder(encoder, formatter)
+ encodeError = EncodeCreateSecretError(encoder, formatter)
)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept"))
@@ -226,7 +226,7 @@ func NewGetSecretHandler(
var (
decodeRequest = DecodeGetSecretRequest(mux, decoder)
encodeResponse = EncodeGetSecretResponse(encoder)
- encodeError = goahttp.ErrorEncoder(encoder, formatter)
+ encodeError = EncodeGetSecretError(encoder, formatter)
)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept"))
@@ -279,7 +279,7 @@ func NewUpdateSecretHandler(
var (
decodeRequest = DecodeUpdateSecretRequest(mux, decoder)
encodeResponse = EncodeUpdateSecretResponse(encoder)
- encodeError = goahttp.ErrorEncoder(encoder, formatter)
+ encodeError = EncodeUpdateSecretError(encoder, formatter)
)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept"))
@@ -332,7 +332,7 @@ func NewDeleteSecretHandler(
var (
decodeRequest = DecodeDeleteSecretRequest(mux, decoder)
encodeResponse = EncodeDeleteSecretResponse(encoder)
- encodeError = goahttp.ErrorEncoder(encoder, formatter)
+ encodeError = EncodeDeleteSecretError(encoder, formatter)
)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept"))
@@ -385,7 +385,7 @@ func NewListSecretsHandler(
var (
decodeRequest = DecodeListSecretsRequest(mux, decoder)
encodeResponse = EncodeListSecretsResponse(encoder)
- encodeError = goahttp.ErrorEncoder(encoder, formatter)
+ encodeError = EncodeListSecretsError(encoder, formatter)
)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept"))
diff --git a/backend-go/internal/server/gen/http/secrets/server/types.go b/backend-go/internal/server/gen/http/secrets/server/types.go
index 079217d93a..5d8999b088 100644
--- a/backend-go/internal/server/gen/http/secrets/server/types.go
+++ b/backend-go/internal/server/gen/http/secrets/server/types.go
@@ -85,6 +85,396 @@ type UpdateSecretResponseBody struct {
// "listSecrets" endpoint HTTP response body.
type SecretResultResponseCollection []*SecretResultResponse
+// GetHealthBadRequestResponseBody is the type of the "secrets" service
+// "getHealth" endpoint HTTP response body for the "bad_request" error.
+type GetHealthBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthUnauthorizedResponseBody is the type of the "secrets" service
+// "getHealth" endpoint HTTP response body for the "unauthorized" error.
+type GetHealthUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthForbiddenResponseBody is the type of the "secrets" service
+// "getHealth" endpoint HTTP response body for the "forbidden" error.
+type GetHealthForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthNotFoundResponseBody is the type of the "secrets" service
+// "getHealth" endpoint HTTP response body for the "not_found" error.
+type GetHealthNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetHealthInternalErrorResponseBody is the type of the "secrets" service
+// "getHealth" endpoint HTTP response body for the "internal_error" error.
+type GetHealthInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateSecretBadRequestResponseBody is the type of the "secrets" service
+// "createSecret" endpoint HTTP response body for the "bad_request" error.
+type CreateSecretBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateSecretUnauthorizedResponseBody is the type of the "secrets" service
+// "createSecret" endpoint HTTP response body for the "unauthorized" error.
+type CreateSecretUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateSecretForbiddenResponseBody is the type of the "secrets" service
+// "createSecret" endpoint HTTP response body for the "forbidden" error.
+type CreateSecretForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateSecretNotFoundResponseBody is the type of the "secrets" service
+// "createSecret" endpoint HTTP response body for the "not_found" error.
+type CreateSecretNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// CreateSecretInternalErrorResponseBody is the type of the "secrets" service
+// "createSecret" endpoint HTTP response body for the "internal_error" error.
+type CreateSecretInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetSecretBadRequestResponseBody is the type of the "secrets" service
+// "getSecret" endpoint HTTP response body for the "bad_request" error.
+type GetSecretBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetSecretUnauthorizedResponseBody is the type of the "secrets" service
+// "getSecret" endpoint HTTP response body for the "unauthorized" error.
+type GetSecretUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetSecretForbiddenResponseBody is the type of the "secrets" service
+// "getSecret" endpoint HTTP response body for the "forbidden" error.
+type GetSecretForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetSecretNotFoundResponseBody is the type of the "secrets" service
+// "getSecret" endpoint HTTP response body for the "not_found" error.
+type GetSecretNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// GetSecretInternalErrorResponseBody is the type of the "secrets" service
+// "getSecret" endpoint HTTP response body for the "internal_error" error.
+type GetSecretInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// UpdateSecretBadRequestResponseBody is the type of the "secrets" service
+// "updateSecret" endpoint HTTP response body for the "bad_request" error.
+type UpdateSecretBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// UpdateSecretUnauthorizedResponseBody is the type of the "secrets" service
+// "updateSecret" endpoint HTTP response body for the "unauthorized" error.
+type UpdateSecretUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// UpdateSecretForbiddenResponseBody is the type of the "secrets" service
+// "updateSecret" endpoint HTTP response body for the "forbidden" error.
+type UpdateSecretForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// UpdateSecretNotFoundResponseBody is the type of the "secrets" service
+// "updateSecret" endpoint HTTP response body for the "not_found" error.
+type UpdateSecretNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// UpdateSecretInternalErrorResponseBody is the type of the "secrets" service
+// "updateSecret" endpoint HTTP response body for the "internal_error" error.
+type UpdateSecretInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// DeleteSecretBadRequestResponseBody is the type of the "secrets" service
+// "deleteSecret" endpoint HTTP response body for the "bad_request" error.
+type DeleteSecretBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// DeleteSecretUnauthorizedResponseBody is the type of the "secrets" service
+// "deleteSecret" endpoint HTTP response body for the "unauthorized" error.
+type DeleteSecretUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// DeleteSecretForbiddenResponseBody is the type of the "secrets" service
+// "deleteSecret" endpoint HTTP response body for the "forbidden" error.
+type DeleteSecretForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// DeleteSecretNotFoundResponseBody is the type of the "secrets" service
+// "deleteSecret" endpoint HTTP response body for the "not_found" error.
+type DeleteSecretNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// DeleteSecretInternalErrorResponseBody is the type of the "secrets" service
+// "deleteSecret" endpoint HTTP response body for the "internal_error" error.
+type DeleteSecretInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// ListSecretsBadRequestResponseBody is the type of the "secrets" service
+// "listSecrets" endpoint HTTP response body for the "bad_request" error.
+type ListSecretsBadRequestResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// ListSecretsUnauthorizedResponseBody is the type of the "secrets" service
+// "listSecrets" endpoint HTTP response body for the "unauthorized" error.
+type ListSecretsUnauthorizedResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// ListSecretsForbiddenResponseBody is the type of the "secrets" service
+// "listSecrets" endpoint HTTP response body for the "forbidden" error.
+type ListSecretsForbiddenResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// ListSecretsNotFoundResponseBody is the type of the "secrets" service
+// "listSecrets" endpoint HTTP response body for the "not_found" error.
+type ListSecretsNotFoundResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
+// ListSecretsInternalErrorResponseBody is the type of the "secrets" service
+// "listSecrets" endpoint HTTP response body for the "internal_error" error.
+type ListSecretsInternalErrorResponseBody struct {
+ // HTTP status code
+ StatusCode int `form:"statusCode" json:"statusCode" xml:"statusCode"`
+ // Human-readable error message
+ Message string `form:"message" json:"message" xml:"message"`
+ // Error class name
+ ErrorClass string `form:"error" json:"error" xml:"error"`
+ // Optional structured details
+ Details any `form:"details,omitempty" json:"details,omitempty" xml:"details,omitempty"`
+}
+
// SecretResultResponse is used to define fields on response body types.
type SecretResultResponse struct {
// Secret ID
@@ -152,6 +542,366 @@ func NewSecretResultResponseCollection(res secretsviews.SecretResultCollectionVi
return body
}
+// NewGetHealthBadRequestResponseBody builds the HTTP response body from the
+// result of the "getHealth" endpoint of the "secrets" service.
+func NewGetHealthBadRequestResponseBody(res *secrets.APIErrorResult) *GetHealthBadRequestResponseBody {
+ body := &GetHealthBadRequestResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetHealthUnauthorizedResponseBody builds the HTTP response body from the
+// result of the "getHealth" endpoint of the "secrets" service.
+func NewGetHealthUnauthorizedResponseBody(res *secrets.APIErrorResult) *GetHealthUnauthorizedResponseBody {
+ body := &GetHealthUnauthorizedResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetHealthForbiddenResponseBody builds the HTTP response body from the
+// result of the "getHealth" endpoint of the "secrets" service.
+func NewGetHealthForbiddenResponseBody(res *secrets.APIErrorResult) *GetHealthForbiddenResponseBody {
+ body := &GetHealthForbiddenResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetHealthNotFoundResponseBody builds the HTTP response body from the
+// result of the "getHealth" endpoint of the "secrets" service.
+func NewGetHealthNotFoundResponseBody(res *secrets.APIErrorResult) *GetHealthNotFoundResponseBody {
+ body := &GetHealthNotFoundResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetHealthInternalErrorResponseBody builds the HTTP response body from the
+// result of the "getHealth" endpoint of the "secrets" service.
+func NewGetHealthInternalErrorResponseBody(res *secrets.APIErrorResult) *GetHealthInternalErrorResponseBody {
+ body := &GetHealthInternalErrorResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewCreateSecretBadRequestResponseBody builds the HTTP response body from the
+// result of the "createSecret" endpoint of the "secrets" service.
+func NewCreateSecretBadRequestResponseBody(res *secrets.APIErrorResult) *CreateSecretBadRequestResponseBody {
+ body := &CreateSecretBadRequestResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewCreateSecretUnauthorizedResponseBody builds the HTTP response body from
+// the result of the "createSecret" endpoint of the "secrets" service.
+func NewCreateSecretUnauthorizedResponseBody(res *secrets.APIErrorResult) *CreateSecretUnauthorizedResponseBody {
+ body := &CreateSecretUnauthorizedResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewCreateSecretForbiddenResponseBody builds the HTTP response body from the
+// result of the "createSecret" endpoint of the "secrets" service.
+func NewCreateSecretForbiddenResponseBody(res *secrets.APIErrorResult) *CreateSecretForbiddenResponseBody {
+ body := &CreateSecretForbiddenResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewCreateSecretNotFoundResponseBody builds the HTTP response body from the
+// result of the "createSecret" endpoint of the "secrets" service.
+func NewCreateSecretNotFoundResponseBody(res *secrets.APIErrorResult) *CreateSecretNotFoundResponseBody {
+ body := &CreateSecretNotFoundResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewCreateSecretInternalErrorResponseBody builds the HTTP response body from
+// the result of the "createSecret" endpoint of the "secrets" service.
+func NewCreateSecretInternalErrorResponseBody(res *secrets.APIErrorResult) *CreateSecretInternalErrorResponseBody {
+ body := &CreateSecretInternalErrorResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetSecretBadRequestResponseBody builds the HTTP response body from the
+// result of the "getSecret" endpoint of the "secrets" service.
+func NewGetSecretBadRequestResponseBody(res *secrets.APIErrorResult) *GetSecretBadRequestResponseBody {
+ body := &GetSecretBadRequestResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetSecretUnauthorizedResponseBody builds the HTTP response body from the
+// result of the "getSecret" endpoint of the "secrets" service.
+func NewGetSecretUnauthorizedResponseBody(res *secrets.APIErrorResult) *GetSecretUnauthorizedResponseBody {
+ body := &GetSecretUnauthorizedResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetSecretForbiddenResponseBody builds the HTTP response body from the
+// result of the "getSecret" endpoint of the "secrets" service.
+func NewGetSecretForbiddenResponseBody(res *secrets.APIErrorResult) *GetSecretForbiddenResponseBody {
+ body := &GetSecretForbiddenResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetSecretNotFoundResponseBody builds the HTTP response body from the
+// result of the "getSecret" endpoint of the "secrets" service.
+func NewGetSecretNotFoundResponseBody(res *secrets.APIErrorResult) *GetSecretNotFoundResponseBody {
+ body := &GetSecretNotFoundResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewGetSecretInternalErrorResponseBody builds the HTTP response body from the
+// result of the "getSecret" endpoint of the "secrets" service.
+func NewGetSecretInternalErrorResponseBody(res *secrets.APIErrorResult) *GetSecretInternalErrorResponseBody {
+ body := &GetSecretInternalErrorResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewUpdateSecretBadRequestResponseBody builds the HTTP response body from the
+// result of the "updateSecret" endpoint of the "secrets" service.
+func NewUpdateSecretBadRequestResponseBody(res *secrets.APIErrorResult) *UpdateSecretBadRequestResponseBody {
+ body := &UpdateSecretBadRequestResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewUpdateSecretUnauthorizedResponseBody builds the HTTP response body from
+// the result of the "updateSecret" endpoint of the "secrets" service.
+func NewUpdateSecretUnauthorizedResponseBody(res *secrets.APIErrorResult) *UpdateSecretUnauthorizedResponseBody {
+ body := &UpdateSecretUnauthorizedResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewUpdateSecretForbiddenResponseBody builds the HTTP response body from the
+// result of the "updateSecret" endpoint of the "secrets" service.
+func NewUpdateSecretForbiddenResponseBody(res *secrets.APIErrorResult) *UpdateSecretForbiddenResponseBody {
+ body := &UpdateSecretForbiddenResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewUpdateSecretNotFoundResponseBody builds the HTTP response body from the
+// result of the "updateSecret" endpoint of the "secrets" service.
+func NewUpdateSecretNotFoundResponseBody(res *secrets.APIErrorResult) *UpdateSecretNotFoundResponseBody {
+ body := &UpdateSecretNotFoundResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewUpdateSecretInternalErrorResponseBody builds the HTTP response body from
+// the result of the "updateSecret" endpoint of the "secrets" service.
+func NewUpdateSecretInternalErrorResponseBody(res *secrets.APIErrorResult) *UpdateSecretInternalErrorResponseBody {
+ body := &UpdateSecretInternalErrorResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewDeleteSecretBadRequestResponseBody builds the HTTP response body from the
+// result of the "deleteSecret" endpoint of the "secrets" service.
+func NewDeleteSecretBadRequestResponseBody(res *secrets.APIErrorResult) *DeleteSecretBadRequestResponseBody {
+ body := &DeleteSecretBadRequestResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewDeleteSecretUnauthorizedResponseBody builds the HTTP response body from
+// the result of the "deleteSecret" endpoint of the "secrets" service.
+func NewDeleteSecretUnauthorizedResponseBody(res *secrets.APIErrorResult) *DeleteSecretUnauthorizedResponseBody {
+ body := &DeleteSecretUnauthorizedResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewDeleteSecretForbiddenResponseBody builds the HTTP response body from the
+// result of the "deleteSecret" endpoint of the "secrets" service.
+func NewDeleteSecretForbiddenResponseBody(res *secrets.APIErrorResult) *DeleteSecretForbiddenResponseBody {
+ body := &DeleteSecretForbiddenResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewDeleteSecretNotFoundResponseBody builds the HTTP response body from the
+// result of the "deleteSecret" endpoint of the "secrets" service.
+func NewDeleteSecretNotFoundResponseBody(res *secrets.APIErrorResult) *DeleteSecretNotFoundResponseBody {
+ body := &DeleteSecretNotFoundResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewDeleteSecretInternalErrorResponseBody builds the HTTP response body from
+// the result of the "deleteSecret" endpoint of the "secrets" service.
+func NewDeleteSecretInternalErrorResponseBody(res *secrets.APIErrorResult) *DeleteSecretInternalErrorResponseBody {
+ body := &DeleteSecretInternalErrorResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewListSecretsBadRequestResponseBody builds the HTTP response body from the
+// result of the "listSecrets" endpoint of the "secrets" service.
+func NewListSecretsBadRequestResponseBody(res *secrets.APIErrorResult) *ListSecretsBadRequestResponseBody {
+ body := &ListSecretsBadRequestResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewListSecretsUnauthorizedResponseBody builds the HTTP response body from
+// the result of the "listSecrets" endpoint of the "secrets" service.
+func NewListSecretsUnauthorizedResponseBody(res *secrets.APIErrorResult) *ListSecretsUnauthorizedResponseBody {
+ body := &ListSecretsUnauthorizedResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewListSecretsForbiddenResponseBody builds the HTTP response body from the
+// result of the "listSecrets" endpoint of the "secrets" service.
+func NewListSecretsForbiddenResponseBody(res *secrets.APIErrorResult) *ListSecretsForbiddenResponseBody {
+ body := &ListSecretsForbiddenResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewListSecretsNotFoundResponseBody builds the HTTP response body from the
+// result of the "listSecrets" endpoint of the "secrets" service.
+func NewListSecretsNotFoundResponseBody(res *secrets.APIErrorResult) *ListSecretsNotFoundResponseBody {
+ body := &ListSecretsNotFoundResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
+// NewListSecretsInternalErrorResponseBody builds the HTTP response body from
+// the result of the "listSecrets" endpoint of the "secrets" service.
+func NewListSecretsInternalErrorResponseBody(res *secrets.APIErrorResult) *ListSecretsInternalErrorResponseBody {
+ body := &ListSecretsInternalErrorResponseBody{
+ StatusCode: res.StatusCode,
+ Message: res.Message,
+ ErrorClass: res.ErrorClass,
+ Details: res.Details,
+ }
+ return body
+}
+
// NewCreateSecretSecret builds a secrets service createSecret endpoint payload.
func NewCreateSecretSecret(body *CreateSecretRequestBody) *secrets.Secret {
v := &secrets.Secret{
diff --git a/backend-go/internal/server/gen/projects/client.go b/backend-go/internal/server/gen/projects/client.go
index a1a7b78aaf..0261130be2 100644
--- a/backend-go/internal/server/gen/projects/client.go
+++ b/backend-go/internal/server/gen/projects/client.go
@@ -29,6 +29,13 @@ func NewClient(getHealth, createProject goa.Endpoint) *Client {
}
// GetHealth calls the "getHealth" endpoint of the "projects" service.
+// GetHealth may return the following errors:
+// - "bad_request" (type *APIErrorResult)
+// - "unauthorized" (type *APIErrorResult)
+// - "forbidden" (type *APIErrorResult)
+// - "not_found" (type *APIErrorResult)
+// - "internal_error" (type *APIErrorResult)
+// - error: internal error
func (c *Client) GetHealth(ctx context.Context) (res string, err error) {
var ires any
ires, err = c.GetHealthEndpoint(ctx, nil)
@@ -39,6 +46,13 @@ func (c *Client) GetHealth(ctx context.Context) (res string, err error) {
}
// CreateProject calls the "createProject" endpoint of the "projects" service.
+// CreateProject may return the following errors:
+// - "bad_request" (type *APIErrorResult)
+// - "unauthorized" (type *APIErrorResult)
+// - "forbidden" (type *APIErrorResult)
+// - "not_found" (type *APIErrorResult)
+// - "internal_error" (type *APIErrorResult)
+// - error: internal error
func (c *Client) CreateProject(ctx context.Context, p *CreateProjectPayload) (res *ProjectResult, err error) {
var ires any
ires, err = c.CreateProjectEndpoint(ctx, p)
diff --git a/backend-go/internal/server/gen/projects/service.go b/backend-go/internal/server/gen/projects/service.go
index 055924fdeb..58915e3e19 100644
--- a/backend-go/internal/server/gen/projects/service.go
+++ b/backend-go/internal/server/gen/projects/service.go
@@ -38,6 +38,17 @@ const ServiceName = "projects"
// MethodKey key.
var MethodNames = [2]string{"getHealth", "createProject"}
+type APIErrorResult struct {
+ // HTTP status code
+ StatusCode int
+ // Human-readable error message
+ Message string
+ // Error class name
+ ErrorClass string
+ // Optional structured details
+ Details any
+}
+
// CreateProjectPayload is the payload type of the projects service
// createProject method.
type CreateProjectPayload struct {
@@ -58,6 +69,23 @@ type ProjectResult struct {
OrgID string
}
+// Error returns an error description.
+func (e *APIErrorResult) Error() string {
+ return ""
+}
+
+// ErrorName returns "APIErrorResult".
+//
+// Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
+func (e *APIErrorResult) ErrorName() string {
+ return e.GoaErrorName()
+}
+
+// GoaErrorName returns "APIErrorResult".
+func (e *APIErrorResult) GoaErrorName() string {
+ return "bad_request"
+}
+
// NewProjectResult initializes result type ProjectResult from viewed result
// type ProjectResult.
func NewProjectResult(vres *projectsviews.ProjectResult) *ProjectResult {
diff --git a/backend-go/internal/server/gen/secrets/client.go b/backend-go/internal/server/gen/secrets/client.go
index 00ffec8561..c442b33a81 100644
--- a/backend-go/internal/server/gen/secrets/client.go
+++ b/backend-go/internal/server/gen/secrets/client.go
@@ -37,6 +37,13 @@ func NewClient(getHealth, createSecret, getSecret, updateSecret, deleteSecret, l
}
// GetHealth calls the "getHealth" endpoint of the "secrets" service.
+// GetHealth may return the following errors:
+// - "bad_request" (type *APIErrorResult)
+// - "unauthorized" (type *APIErrorResult)
+// - "forbidden" (type *APIErrorResult)
+// - "not_found" (type *APIErrorResult)
+// - "internal_error" (type *APIErrorResult)
+// - error: internal error
func (c *Client) GetHealth(ctx context.Context) (res string, err error) {
var ires any
ires, err = c.GetHealthEndpoint(ctx, nil)
@@ -47,6 +54,13 @@ func (c *Client) GetHealth(ctx context.Context) (res string, err error) {
}
// CreateSecret calls the "createSecret" endpoint of the "secrets" service.
+// CreateSecret may return the following errors:
+// - "bad_request" (type *APIErrorResult)
+// - "unauthorized" (type *APIErrorResult)
+// - "forbidden" (type *APIErrorResult)
+// - "not_found" (type *APIErrorResult)
+// - "internal_error" (type *APIErrorResult)
+// - error: internal error
func (c *Client) CreateSecret(ctx context.Context, p *Secret) (res *SecretResult, err error) {
var ires any
ires, err = c.CreateSecretEndpoint(ctx, p)
@@ -57,6 +71,13 @@ func (c *Client) CreateSecret(ctx context.Context, p *Secret) (res *SecretResult
}
// GetSecret calls the "getSecret" endpoint of the "secrets" service.
+// GetSecret may return the following errors:
+// - "bad_request" (type *APIErrorResult)
+// - "unauthorized" (type *APIErrorResult)
+// - "forbidden" (type *APIErrorResult)
+// - "not_found" (type *APIErrorResult)
+// - "internal_error" (type *APIErrorResult)
+// - error: internal error
func (c *Client) GetSecret(ctx context.Context, p *GetSecretPayload) (res *SecretResult, err error) {
var ires any
ires, err = c.GetSecretEndpoint(ctx, p)
@@ -67,6 +88,13 @@ func (c *Client) GetSecret(ctx context.Context, p *GetSecretPayload) (res *Secre
}
// UpdateSecret calls the "updateSecret" endpoint of the "secrets" service.
+// UpdateSecret may return the following errors:
+// - "bad_request" (type *APIErrorResult)
+// - "unauthorized" (type *APIErrorResult)
+// - "forbidden" (type *APIErrorResult)
+// - "not_found" (type *APIErrorResult)
+// - "internal_error" (type *APIErrorResult)
+// - error: internal error
func (c *Client) UpdateSecret(ctx context.Context, p *UpdateSecretPayload) (res *SecretResult, err error) {
var ires any
ires, err = c.UpdateSecretEndpoint(ctx, p)
@@ -77,12 +105,26 @@ func (c *Client) UpdateSecret(ctx context.Context, p *UpdateSecretPayload) (res
}
// DeleteSecret calls the "deleteSecret" endpoint of the "secrets" service.
+// DeleteSecret may return the following errors:
+// - "bad_request" (type *APIErrorResult)
+// - "unauthorized" (type *APIErrorResult)
+// - "forbidden" (type *APIErrorResult)
+// - "not_found" (type *APIErrorResult)
+// - "internal_error" (type *APIErrorResult)
+// - error: internal error
func (c *Client) DeleteSecret(ctx context.Context, p *DeleteSecretPayload) (err error) {
_, err = c.DeleteSecretEndpoint(ctx, p)
return
}
// ListSecrets calls the "listSecrets" endpoint of the "secrets" service.
+// ListSecrets may return the following errors:
+// - "bad_request" (type *APIErrorResult)
+// - "unauthorized" (type *APIErrorResult)
+// - "forbidden" (type *APIErrorResult)
+// - "not_found" (type *APIErrorResult)
+// - "internal_error" (type *APIErrorResult)
+// - error: internal error
func (c *Client) ListSecrets(ctx context.Context, p *ListSecretsPayload) (res SecretResultCollection, err error) {
var ires any
ires, err = c.ListSecretsEndpoint(ctx, p)
diff --git a/backend-go/internal/server/gen/secrets/service.go b/backend-go/internal/server/gen/secrets/service.go
index a6335c93ec..b493f04514 100644
--- a/backend-go/internal/server/gen/secrets/service.go
+++ b/backend-go/internal/server/gen/secrets/service.go
@@ -46,6 +46,17 @@ const ServiceName = "secrets"
// MethodKey key.
var MethodNames = [6]string{"getHealth", "createSecret", "getSecret", "updateSecret", "deleteSecret", "listSecrets"}
+type APIErrorResult struct {
+ // HTTP status code
+ StatusCode int
+ // Human-readable error message
+ Message string
+ // Error class name
+ ErrorClass string
+ // Optional structured details
+ Details any
+}
+
// DeleteSecretPayload is the payload type of the secrets service deleteSecret
// method.
type DeleteSecretPayload struct {
@@ -109,6 +120,23 @@ type UpdateSecretPayload struct {
Value *string
}
+// Error returns an error description.
+func (e *APIErrorResult) Error() string {
+ return ""
+}
+
+// ErrorName returns "APIErrorResult".
+//
+// Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
+func (e *APIErrorResult) ErrorName() string {
+ return e.GoaErrorName()
+}
+
+// GoaErrorName returns "APIErrorResult".
+func (e *APIErrorResult) GoaErrorName() string {
+ return "bad_request"
+}
+
// NewSecretResult initializes result type SecretResult from viewed result type
// SecretResult.
func NewSecretResult(vres *secretsviews.SecretResult) *SecretResult {
diff --git a/backend-go/internal/server/platform.go b/backend-go/internal/server/platform.go
index efeda474d6..d29fe782bc 100644
--- a/backend-go/internal/server/platform.go
+++ b/backend-go/internal/server/platform.go
@@ -7,6 +7,6 @@ import (
func (s *Server) mountPlatform() {
projectsEndpoints := genprojects.NewEndpoints(s.svc.Platform.Projects)
- projectsServer := projectssvr.New(projectsEndpoints, s.mux, s.dec, s.enc, s.eh, nil)
+ projectsServer := projectssvr.New(projectsEndpoints, s.mux, s.dec, s.enc, s.eh, s.formatter)
projectssvr.Mount(s.mux, projectsServer)
}
diff --git a/backend-go/internal/server/secretmanager.go b/backend-go/internal/server/secretmanager.go
index de43f838f5..f3210825b9 100644
--- a/backend-go/internal/server/secretmanager.go
+++ b/backend-go/internal/server/secretmanager.go
@@ -7,7 +7,7 @@ import (
func (s *Server) mountSecretManager() {
secretsEndpoints := gensecrets.NewEndpoints(s.svc.SecretManager.Secrets)
- secretsServer := secretssvr.New(secretsEndpoints, s.mux, s.dec, s.enc, s.eh, nil)
+ secretsServer := secretssvr.New(secretsEndpoints, s.mux, s.dec, s.enc, s.eh, s.formatter)
secretssvr.Mount(s.mux, secretsServer)
}
diff --git a/backend-go/internal/server/server.go b/backend-go/internal/server/server.go
index 265ebcf53c..1770e7faab 100644
--- a/backend-go/internal/server/server.go
+++ b/backend-go/internal/server/server.go
@@ -9,28 +9,32 @@ import (
goahttp "goa.design/goa/v3/http"
+ "github.com/infisical/api/internal/libs/errutil"
"github.com/infisical/api/internal/services"
)
type Server struct {
- svc *services.Registry
- logger *slog.Logger
- mux goahttp.Muxer
- dec func(*http.Request) goahttp.Decoder
- enc func(context.Context, http.ResponseWriter) goahttp.Encoder
- eh func(context.Context, http.ResponseWriter, error)
+ svc *services.Registry
+ logger *slog.Logger
+ mux goahttp.Muxer
+ dec func(*http.Request) goahttp.Decoder
+ enc func(context.Context, http.ResponseWriter) goahttp.Encoder
+ eh func(context.Context, http.ResponseWriter, error)
+ formatter func(ctx context.Context, err error) goahttp.Statuser
}
func NewServer(svc *services.Registry, logger *slog.Logger) *Server {
s := &Server{
- svc: svc,
- logger: logger,
- mux: goahttp.NewMuxer(),
- dec: goahttp.RequestDecoder,
- enc: goahttp.ResponseEncoder,
+ svc: svc,
+ logger: logger,
+ mux: goahttp.NewMuxer(),
+ dec: goahttp.RequestDecoder,
+ enc: goahttp.ResponseEncoder,
+ formatter: errutil.NewFormatter(logger),
}
+ // eh only fires when encoding the error response itself fails.
s.eh = func(ctx context.Context, w http.ResponseWriter, err error) {
- logger.ErrorContext(ctx, "server error", "error", err)
+ logger.ErrorContext(ctx, "failed to encode error response", slog.Any("error", err))
}
s.mountPlatform()
@@ -51,18 +55,18 @@ func (s *Server) Listen(ctx context.Context, addr string, wg *sync.WaitGroup, er
wg.Go(func() {
go func() {
- s.logger.Info("HTTP server listening", "addr", addr)
+ s.logger.Info("HTTP server listening", slog.String("addr", addr))
errc <- srv.ListenAndServe()
}()
<-ctx.Done()
- s.logger.Info("shutting down HTTP server", "addr", addr)
+ s.logger.Info("shutting down HTTP server", slog.String("addr", addr))
shutdownCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
if err := srv.Shutdown(shutdownCtx); err != nil {
- s.logger.Error("HTTP server shutdown error", "error", err)
+ s.logger.Error("HTTP server shutdown error", slog.Any("error", err))
}
})
}
@@ -72,10 +76,10 @@ func requestLogger(next http.Handler, logger *slog.Logger) http.Handler {
start := time.Now()
next.ServeHTTP(w, r)
logger.Info("request",
- "method", r.Method,
- "path", r.URL.Path,
- "duration", time.Since(start).String(),
- "remote", r.RemoteAddr,
+ slog.String("method", r.Method),
+ slog.String("path", r.URL.Path),
+ slog.String("duration", time.Since(start).String()),
+ slog.String("remote", r.RemoteAddr),
)
})
}
diff --git a/backend-go/internal/services/platform/platform.go b/backend-go/internal/services/platform/platform.go
index 729752b16e..95ee9c11aa 100644
--- a/backend-go/internal/services/platform/platform.go
+++ b/backend-go/internal/services/platform/platform.go
@@ -13,7 +13,7 @@ type Registry struct {
}
func NewRegistry(logger *slog.Logger, sharedLibs *shared.SharedServices) *Registry {
- l := logger.With("product", "platform")
+ l := logger.With(slog.String("product", "platform"))
return &Registry{
Projects: projects.NewService(l, projects.Deps{
Permission: sharedLibs.Permission,
diff --git a/backend-go/internal/services/platform/projects/projects.go b/backend-go/internal/services/platform/projects/projects.go
index 5b6b28f93a..12b35d51cf 100644
--- a/backend-go/internal/services/platform/projects/projects.go
+++ b/backend-go/internal/services/platform/projects/projects.go
@@ -24,7 +24,7 @@ type Deps struct {
func NewService(logger *slog.Logger, deps Deps) genprojects.Service {
return &service{
- logger: logger.With("service", "projects"),
+ logger: logger.With(slog.String("service", "projects")),
permission: deps.Permission,
}
}
@@ -35,7 +35,7 @@ func (s *service) GetHealth(ctx context.Context) (string, error) {
}
func (s *service) CreateProject(ctx context.Context, p *genprojects.CreateProjectPayload) (*genprojects.ProjectResult, error) {
- s.logger.InfoContext(ctx, "creating project", "name", p.Name)
+ s.logger.InfoContext(ctx, "creating project", slog.String("name", p.Name))
return &genprojects.ProjectResult{
ID: "generated-id",
Name: p.Name,
diff --git a/backend-go/internal/services/secretmanager/secret_manager.go b/backend-go/internal/services/secretmanager/secret_manager.go
index e607d19585..3974b87aee 100644
--- a/backend-go/internal/services/secretmanager/secret_manager.go
+++ b/backend-go/internal/services/secretmanager/secret_manager.go
@@ -15,7 +15,7 @@ type Registry struct {
}
func NewRegistry(logger *slog.Logger, db pg.DB, sharedServices *shared.SharedServices) *Registry {
- l := logger.With("product", "secretmanager")
+ l := logger.With(slog.String("product", "secretmanager"))
smSharedService := smService.NewSharedServices(smService.SharedServicesDeps{
DB: db,
diff --git a/backend-go/internal/services/secretmanager/secrets/secrets.go b/backend-go/internal/services/secretmanager/secrets/secrets.go
index 95ccd43a4d..cf16ce1d09 100644
--- a/backend-go/internal/services/secretmanager/secrets/secrets.go
+++ b/backend-go/internal/services/secretmanager/secrets/secrets.go
@@ -28,7 +28,7 @@ type Deps struct {
func NewService(logger *slog.Logger, deps Deps) gensecrets.Service {
return &service{
- logger: logger.With("service", "secrets"),
+ logger: logger.With(slog.String("service", "secrets")),
permissionSvc: deps.Permission,
secretFolderSvc: deps.SecretFolder,
}
@@ -40,7 +40,7 @@ func (s *service) GetHealth(ctx context.Context) (string, error) {
}
func (s *service) CreateSecret(ctx context.Context, p *gensecrets.Secret) (*gensecrets.SecretResult, error) {
- s.logger.InfoContext(ctx, "creating secret", "key", p.Key)
+ s.logger.InfoContext(ctx, "creating secret", slog.String("key", p.Key))
return &gensecrets.SecretResult{
ID: "generated-id",
Key: p.Key,
@@ -51,7 +51,7 @@ func (s *service) CreateSecret(ctx context.Context, p *gensecrets.Secret) (*gens
}
func (s *service) GetSecret(ctx context.Context, p *gensecrets.GetSecretPayload) (*gensecrets.SecretResult, error) {
- s.logger.InfoContext(ctx, "getting secret", "id", p.ID)
+ s.logger.InfoContext(ctx, "getting secret", slog.String("id", p.ID))
_, err := s.permissionSvc.GetProjectPermission(ctx, &permission.GetProjectPermissionArgs{
ProjectID: "",
})
@@ -63,16 +63,16 @@ func (s *service) GetSecret(ctx context.Context, p *gensecrets.GetSecretPayload)
}
func (s *service) UpdateSecret(ctx context.Context, p *gensecrets.UpdateSecretPayload) (*gensecrets.SecretResult, error) {
- s.logger.InfoContext(ctx, "updating secret", "id", p.ID)
+ s.logger.InfoContext(ctx, "updating secret", slog.String("id", p.ID))
return &gensecrets.SecretResult{ID: p.ID, Key: "updated", Value: "updated", Environment: "dev", ProjectID: "proj-1"}, nil
}
func (s *service) DeleteSecret(ctx context.Context, p *gensecrets.DeleteSecretPayload) error {
- s.logger.InfoContext(ctx, "deleting secret", "id", p.ID)
+ s.logger.InfoContext(ctx, "deleting secret", slog.String("id", p.ID))
return nil
}
func (s *service) ListSecrets(ctx context.Context, p *gensecrets.ListSecretsPayload) (gensecrets.SecretResultCollection, error) {
- s.logger.InfoContext(ctx, "listing secrets", "projectId", p.ProjectID, "env", p.Environment)
+ s.logger.InfoContext(ctx, "listing secrets", slog.String("projectId", p.ProjectID), slog.String("env", p.Environment))
return gensecrets.SecretResultCollection{}, nil
}
diff --git a/backend-go/internal/services/shared/license/license.go b/backend-go/internal/services/shared/license/license.go
index 35658247bb..b8fafcf1cf 100644
--- a/backend-go/internal/services/shared/license/license.go
+++ b/backend-go/internal/services/shared/license/license.go
@@ -136,7 +136,7 @@ type Deps struct {
func NewSharedService(ctx context.Context, logger *slog.Logger, deps Deps) *SharedService {
svc := &SharedService{
- logger: logger.With("svc", "license"),
+ logger: logger.With(slog.String("svc", "license")),
onPremFeatures: DefaultFeatures(),
keyStore: deps.KeyStore,
dal: deps.DAL,
@@ -158,7 +158,7 @@ func NewSharedService(ctx context.Context, logger *slog.Logger, deps Deps) *Shar
func (s *SharedService) init(ctx context.Context, cfg *config.Config) {
defer func() {
if r := recover(); r != nil {
- s.logger.Error("panic during license init", "recover", r)
+ s.logger.Error("panic during license init", slog.Any("recover", r))
}
}()
@@ -166,14 +166,14 @@ func (s *SharedService) init(ctx context.Context, cfg *config.Config) {
if cfg.LicenseServerKey != "" {
token, err := s.cloudAPI.refreshToken(ctx)
if err != nil {
- s.logger.Error("cloud license login failed", "error", err)
+ s.logger.Error("cloud license login failed", slog.Any("error", err))
s.isValid = true // allow OSS fallback
return
}
if token != "" {
s.instanceType = InstanceTypeCloud
}
- s.logger.Info("license initialized", "instanceType", InstanceTypeCloud)
+ s.logger.Info("license initialized", slog.String("instanceType", string(InstanceTypeCloud)))
s.isValid = true
return
}
@@ -186,16 +186,16 @@ func (s *SharedService) init(ctx context.Context, cfg *config.Config) {
s.onPremAPI.apiKey = licenseKey
token, err := s.onPremAPI.refreshToken(ctx)
if err != nil {
- s.logger.Error("on-prem license login failed", "error", err)
+ s.logger.Error("on-prem license login failed", slog.Any("error", err))
s.isValid = true
return
}
if token != "" {
if err := s.syncOnPremFeatures(ctx); err != nil {
- s.logger.Error("initial on-prem feature sync failed", "error", err)
+ s.logger.Error("initial on-prem feature sync failed", slog.Any("error", err))
}
s.instanceType = InstanceTypeEnterpriseOnPrem
- s.logger.Info("license initialized", "instanceType", InstanceTypeEnterpriseOnPrem)
+ s.logger.Info("license initialized", slog.String("instanceType", string(InstanceTypeEnterpriseOnPrem)))
s.isValid = true
}
return
@@ -204,10 +204,10 @@ func (s *SharedService) init(ctx context.Context, cfg *config.Config) {
// 3. Offline enterprise license.
if licenseKey != "" && licenseType == OfflineLicenseType {
if err := s.loadOfflineLicense(licenseKey); err != nil {
- s.logger.Warn("offline license validation failed", "error", err)
+ s.logger.Warn("offline license validation failed", slog.Any("error", err))
} else {
s.instanceType = InstanceTypeEnterpriseOnPremOffline
- s.logger.Info("license initialized", "instanceType", InstanceTypeEnterpriseOnPremOffline)
+ s.logger.Info("license initialized", slog.String("instanceType", string(InstanceTypeEnterpriseOnPremOffline)))
s.isValid = true
return
}
@@ -216,7 +216,7 @@ func (s *SharedService) init(ctx context.Context, cfg *config.Config) {
// 4. Self-hosted OSS fallback.
s.instanceType = InstanceTypeOnPrem
s.isValid = true
- s.logger.Info("license initialized", "instanceType", InstanceTypeOnPrem)
+ s.logger.Info("license initialized", slog.String("instanceType", string(InstanceTypeOnPrem)))
}
// detectLicenseKey determines the license key and its type (online/offline).
@@ -334,7 +334,7 @@ func (s *SharedService) GetPlan(ctx context.Context, orgID string) (*FeatureSet,
}
endpoint := fmt.Sprintf("/api/license-server/v1/customers/%s/cloud-plan", org.CustomerID.String)
if err := s.cloudAPI.get(ctx, endpoint, &resp); err != nil {
- s.logger.Error("failed to fetch cloud plan", "orgID", orgID, "error", err)
+ s.logger.Error("failed to fetch cloud plan", slog.String("orgID", orgID), slog.Any("error", err))
return s.fallbackPlan(ctx, cacheKey), nil
}
@@ -382,7 +382,7 @@ func (s *SharedService) startBackgroundSync() {
ctx, cancel := context.WithCancel(context.Background())
s.stopSync = cancel
- s.logger.Info("starting background license sync", "interval", syncInterval)
+ s.logger.Info("starting background license sync", slog.Duration("interval", syncInterval))
go func() {
ticker := time.NewTicker(syncInterval)
defer ticker.Stop()
@@ -394,7 +394,7 @@ func (s *SharedService) startBackgroundSync() {
return
case <-ticker.C:
if err := s.syncOnPremFeatures(ctx); err != nil {
- s.logger.Error("background license sync failed", "error", err)
+ s.logger.Error("background license sync failed", slog.Any("error", err))
}
}
}
diff --git a/backend-go/internal/services/shared/serverconfig/serverconfig.go b/backend-go/internal/services/shared/serverconfig/serverconfig.go
index 5aaf4562a0..fe1e1c9d3b 100644
--- a/backend-go/internal/services/shared/serverconfig/serverconfig.go
+++ b/backend-go/internal/services/shared/serverconfig/serverconfig.go
@@ -169,7 +169,7 @@ func (s *SharedService) GetConfig(ctx context.Context) (ServerConfig, error) {
// Populate cache (non-fatal on error).
if data, err := json.Marshal(cfg); err == nil {
if err := s.keyStore.SetItemWithExpiry(ctx, adminConfigCacheKey, adminConfigCacheTTL, string(data)); err != nil {
- s.logger.ErrorContext(ctx, "setting config in cache", "error", err)
+ s.logger.ErrorContext(ctx, "setting config in cache", slog.Any("error", err))
}
}
diff --git a/backend-go/internal/testutil/logger.go b/backend-go/internal/testutil/logger.go
index 656878e962..e0e5c28a58 100644
--- a/backend-go/internal/testutil/logger.go
+++ b/backend-go/internal/testutil/logger.go
@@ -1,11 +1,10 @@
package testutil
import (
- "io"
"log/slog"
)
// NopLogger returns a logger that discards all output.
func NopLogger() *slog.Logger {
- return slog.New(slog.NewTextHandler(io.Discard, nil))
+ return slog.New(slog.DiscardHandler)
}