Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
feat: addressed llm review
=25c990c5fe78
diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.tsindex 9ad57330a0..919a560901 100644--- a/backend/src/server/routes/index.ts+++ b/backend/src/server/routes/index.ts@@ -4625,7 +4625,11 @@ export const registerRoutes = async (rateLimit: readLimit},schema: {- operationId: "getServerStatus",+ hide: false,+ operationId: "getInstanceStatus",+ tags: [ApiDocsTags.Instance],+ description:+ "Get the status of the Infisical instance and the features configured on it. Public and unauthenticated; used by liveness and readiness probes and exempt from the API-wide rate limit.",response: {200: z.object({date: z.date(),diff --git a/tests/Makefile b/tests/Makefileindex b37d6a342c..202c97853c 100644--- a/tests/Makefile+++ b/tests/Makefile@@ -41,7 +41,11 @@ test-docker:# `up` would silently adopt it. The trap fires on Ctrl-C too, so an interrupted run# still cleans up.#-# The recipe's exit status is still `go test`'s, so a failure stays a failure.+# `up` runs inside the recipe rather than as a prerequisite, so the trap is already+# installed when it starts and a stack that fails halfway through booting is torn+# down too.+#+# The recipe's exit status is still that of whichever command failed.# Separate targets so a red line says which thing broke. `test-suites` failing means# Infisical is broken; `test-harness` failing means the harness is. One target running# both would report them the same way.@@ -49,8 +53,9 @@ test-suites: PKGS = ./suites/...test-harness: PKGS = ./harnesstest/...test-all: PKGS = ./suites/... ./harnesstest/...-test-suites test-harness test-all: up- @trap '$(MAKE) --no-print-directory down' EXIT; go test $(PKGS) -count=1+test-suites test-harness test-all:+ @trap '$(MAKE) --no-print-directory down' EXIT; \+ go run ./cmd/inf up && go test $(PKGS) -count=1up:go run ./cmd/inf updiff --git a/tests/clients/api/api.gen.go b/tests/clients/api/api.gen.goindex 4c7dc78a9d..15ed2b3331 100644--- a/tests/clients/api/api.gen.go+++ b/tests/clients/api/api.gen.go@@ -18,90 +18,90 @@ import (openapi_types "github.com/oapi-codegen/runtime/types")-// Defines values for GetServerStatus400JSONResponseBodyStatusCode.+// Defines values for GetInstanceStatus400JSONResponseBodyStatusCode.const (- GetServerStatus400JSONResponseBodyStatusCodeN400 GetServerStatus400JSONResponseBodyStatusCode = 400+ GetInstanceStatus400JSONResponseBodyStatusCodeN400 GetInstanceStatus400JSONResponseBodyStatusCode = 400)-// Valid indicates whether the value is a known member of the GetServerStatus400JSONResponseBodyStatusCode enum.-func (e GetServerStatus400JSONResponseBodyStatusCode) Valid() bool {+// Valid indicates whether the value is a known member of the GetInstanceStatus400JSONResponseBodyStatusCode enum.+func (e GetInstanceStatus400JSONResponseBodyStatusCode) Valid() bool {switch e {- case GetServerStatus400JSONResponseBodyStatusCodeN400:+ case GetInstanceStatus400JSONResponseBodyStatusCodeN400:return truedefault:return false}}-// Defines values for GetServerStatus401JSONResponseBodyStatusCode.+// Defines values for GetInstanceStatus401JSONResponseBodyStatusCode.const (- GetServerStatus401JSONResponseBodyStatusCodeN401 GetServerStatus401JSONResponseBodyStatusCode = 401+ GetInstanceStatus401JSONResponseBodyStatusCodeN401 GetInstanceStatus401JSONResponseBodyStatusCode = 401)-// Valid indicates whether the value is a known member of the GetServerStatus401JSONResponseBodyStatusCode enum.-func (e GetServerStatus401JSONResponseBodyStatusCode) Valid() bool {+// Valid indicates whether the value is a known member of the GetInstanceStatus401JSONResponseBodyStatusCode enum.+func (e GetInstanceStatus401JSONResponseBodyStatusCode) Valid() bool {switch e {- case GetServerStatus401JSONResponseBodyStatusCodeN401:+ case GetInstanceStatus401JSONResponseBodyStatusCodeN401:return truedefault:return false}}-// Defines values for GetServerStatus403JSONResponseBodyStatusCode.+// Defines values for GetInstanceStatus403JSONResponseBodyStatusCode.const (- GetServerStatus403JSONResponseBodyStatusCodeN403 GetServerStatus403JSONResponseBodyStatusCode = 403+ GetInstanceStatus403JSONResponseBodyStatusCodeN403 GetInstanceStatus403JSONResponseBodyStatusCode = 403)-// Valid indicates whether the value is a known member of the GetServerStatus403JSONResponseBodyStatusCode enum.-func (e GetServerStatus403JSONResponseBodyStatusCode) Valid() bool {+// Valid indicates whether the value is a known member of the GetInstanceStatus403JSONResponseBodyStatusCode enum.+func (e GetInstanceStatus403JSONResponseBodyStatusCode) Valid() bool {switch e {- case GetServerStatus403JSONResponseBodyStatusCodeN403:+ case GetInstanceStatus403JSONResponseBodyStatusCodeN403:return truedefault:return false}}-// Defines values for GetServerStatus404JSONResponseBodyStatusCode.+// Defines values for GetInstanceStatus404JSONResponseBodyStatusCode.const (- GetServerStatus404JSONResponseBodyStatusCodeN404 GetServerStatus404JSONResponseBodyStatusCode = 404+ GetInstanceStatus404JSONResponseBodyStatusCodeN404 GetInstanceStatus404JSONResponseBodyStatusCode = 404)-// Valid indicates whether the value is a known member of the GetServerStatus404JSONResponseBodyStatusCode enum.-func (e GetServerStatus404JSONResponseBodyStatusCode) Valid() bool {+// Valid indicates whether the value is a known member of the GetInstanceStatus404JSONResponseBodyStatusCode enum.+func (e GetInstanceStatus404JSONResponseBodyStatusCode) Valid() bool {switch e {- case GetServerStatus404JSONResponseBodyStatusCodeN404:+ case GetInstanceStatus404JSONResponseBodyStatusCodeN404:return truedefault:return false}}-// Defines values for GetServerStatus422JSONResponseBodyStatusCode.+// Defines values for GetInstanceStatus422JSONResponseBodyStatusCode.const (- GetServerStatus422JSONResponseBodyStatusCodeN422 GetServerStatus422JSONResponseBodyStatusCode = 422+ GetInstanceStatus422JSONResponseBodyStatusCodeN422 GetInstanceStatus422JSONResponseBodyStatusCode = 422)-// Valid indicates whether the value is a known member of the GetServerStatus422JSONResponseBodyStatusCode enum.-func (e GetServerStatus422JSONResponseBodyStatusCode) Valid() bool {+// Valid indicates whether the value is a known member of the GetInstanceStatus422JSONResponseBodyStatusCode enum.+func (e GetInstanceStatus422JSONResponseBodyStatusCode) Valid() bool {switch e {- case GetServerStatus422JSONResponseBodyStatusCodeN422:+ case GetInstanceStatus422JSONResponseBodyStatusCodeN422:return truedefault:return false}}-// Defines values for GetServerStatus500JSONResponseBodyStatusCode.+// Defines values for GetInstanceStatus500JSONResponseBodyStatusCode.const (- GetServerStatus500JSONResponseBodyStatusCodeN500 GetServerStatus500JSONResponseBodyStatusCode = 500+ GetInstanceStatus500JSONResponseBodyStatusCodeN500 GetInstanceStatus500JSONResponseBodyStatusCode = 500)-// Valid indicates whether the value is a known member of the GetServerStatus500JSONResponseBodyStatusCode enum.-func (e GetServerStatus500JSONResponseBodyStatusCode) Valid() bool {+// Valid indicates whether the value is a known member of the GetInstanceStatus500JSONResponseBodyStatusCode enum.+func (e GetInstanceStatus500JSONResponseBodyStatusCode) Valid() bool {switch e {- case GetServerStatus500JSONResponseBodyStatusCodeN500:+ case GetInstanceStatus500JSONResponseBodyStatusCodeN500:return truedefault:return false@@ -4824,23 +4824,23 @@ func (e CreateSecretV4500JSONResponseBodyStatusCode) Valid() bool {}}-// GetServerStatus400JSONResponseBodyStatusCode defines parameters for GetServerStatus.-type GetServerStatus400JSONResponseBodyStatusCode float32+// GetInstanceStatus400JSONResponseBodyStatusCode defines parameters for GetInstanceStatus.+type GetInstanceStatus400JSONResponseBodyStatusCode float32-// GetServerStatus401JSONResponseBodyStatusCode defines parameters for GetServerStatus.-type GetServerStatus401JSONResponseBodyStatusCode float32+// GetInstanceStatus401JSONResponseBodyStatusCode defines parameters for GetInstanceStatus.+type GetInstanceStatus401JSONResponseBodyStatusCode float32-// GetServerStatus403JSONResponseBodyStatusCode defines parameters for GetServerStatus.-type GetServerStatus403JSONResponseBodyStatusCode float32+// GetInstanceStatus403JSONResponseBodyStatusCode defines parameters for GetInstanceStatus.+type GetInstanceStatus403JSONResponseBodyStatusCode float32-// GetServerStatus404JSONResponseBodyStatusCode defines parameters for GetServerStatus.-type GetServerStatus404JSONResponseBodyStatusCode float32+// GetInstanceStatus404JSONResponseBodyStatusCode defines parameters for GetInstanceStatus.+type GetInstanceStatus404JSONResponseBodyStatusCode float32-// GetServerStatus422JSONResponseBodyStatusCode defines parameters for GetServerStatus.-type GetServerStatus422JSONResponseBodyStatusCode float32+// GetInstanceStatus422JSONResponseBodyStatusCode defines parameters for GetInstanceStatus.+type GetInstanceStatus422JSONResponseBodyStatusCode float32-// GetServerStatus500JSONResponseBodyStatusCode defines parameters for GetServerStatus.-type GetServerStatus500JSONResponseBodyStatusCode float32+// GetInstanceStatus500JSONResponseBodyStatusCode defines parameters for GetInstanceStatus.+type GetInstanceStatus500JSONResponseBodyStatusCode float32// AdminBootstrapJSONBody defines parameters for AdminBootstrap.type AdminBootstrapJSONBody struct {@@ -9200,8 +9200,10 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption {// The interface specification for the client above.type ClientInterface interface {- // GetServerStatus performs a GET /api/status (the `GetServerStatus` operationId) request.- GetServerStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)+ // GetInstanceStatus performs a GET /api/status (the `GetInstanceStatus` operationId) request.+ //+ // Get the status of the Infisical instance and the features configured on it. Public and unauthenticated; used by liveness and readiness probes and exempt from the API-wide rate limit.+ GetInstanceStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)// AdminBootstrapWithBody performs a POST /api/v1/admin/bootstrap (the `AdminBootstrap` operationId) request,// with any type of body and a specified content type.@@ -9477,9 +9479,11 @@ type ClientInterface interface {CreateSecretV4(ctx context.Context, secretName string, body CreateSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)}-// GetServerStatus performs a GET /api/status (the `GetServerStatus` operationId) request.-func (c *Client) GetServerStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {- req, err := NewGetServerStatusRequest(c.Server)+// GetInstanceStatus performs a GET /api/status (the `GetInstanceStatus` operationId) request.+//+// Get the status of the Infisical instance and the features configured on it. Public and unauthenticated; used by liveness and readiness probes and exempt from the API-wide rate limit.+func (c *Client) GetInstanceStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {+ req, err := NewGetInstanceStatusRequest(c.Server)if err != nil {return nil, err}@@ -10313,8 +10317,8 @@ func (c *Client) CreateSecretV4(ctx context.Context, secretName string, body Crereturn c.Client.Do(req)}-// NewGetServerStatusRequest constructs an http.Request for the GetServerStatus method-func NewGetServerStatusRequest(server string) (*http.Request, error) {+// NewGetInstanceStatusRequest constructs an http.Request for the GetInstanceStatus method+func NewGetInstanceStatusRequest(server string) (*http.Request, error) {var err errorserverURL, err := url.Parse(server)@@ -12027,10 +12031,12 @@ func WithBaseURL(baseURL string) ClientOption {// ClientWithResponsesInterface is the interface specification for the client with responses above.type ClientWithResponsesInterface interface {- // GetServerStatusWithResponse performs a GET /api/status (the `GetServerStatus` operationId) request.+ // GetInstanceStatusWithResponse performs a GET /api/status (the `GetInstanceStatus` operationId) request.+ //+ // Get the status of the Infisical instance and the features configured on it. Public and unauthenticated; used by liveness and readiness probes and exempt from the API-wide rate limit.//// Returns a wrapper object for the known response body format(s).- GetServerStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetServerStatusResponse, error)+ GetInstanceStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetInstanceStatusResponse, error)// AdminBootstrapWithBodyWithResponse performs a POST /api/v1/admin/bootstrap (the `AdminBootstrap` operationId) request,// with any type of body and a specified content type.@@ -12372,7 +12378,7 @@ type ClientWithResponsesInterface interface {CreateSecretV4WithResponse(ctx context.Context, secretName string, body CreateSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSecretV4Response, error)}-type GetServerStatusResponse struct {+type GetInstanceStatusResponse struct {Body []byteHTTPResponse *http.Response// JSON200 the response for an HTTP 200 `application/json` response@@ -12389,52 +12395,52 @@ type GetServerStatusResponse struct {}// JSON400 the response for an HTTP 400 `application/json` responseJSON400 *struct {- Details interface{} `json:"details,omitempty"`- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus400JSONResponseBodyStatusCode `json:"statusCode"`+ Details interface{} `json:"details,omitempty"`+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus400JSONResponseBodyStatusCode `json:"statusCode"`}// JSON401 the response for an HTTP 401 `application/json` responseJSON401 *struct {- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus401JSONResponseBodyStatusCode `json:"statusCode"`+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus401JSONResponseBodyStatusCode `json:"statusCode"`}// JSON403 the response for an HTTP 403 `application/json` responseJSON403 *struct {- Details interface{} `json:"details,omitempty"`- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus403JSONResponseBodyStatusCode `json:"statusCode"`+ Details interface{} `json:"details,omitempty"`+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus403JSONResponseBodyStatusCode `json:"statusCode"`}// JSON404 the response for an HTTP 404 `application/json` responseJSON404 *struct {- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus404JSONResponseBodyStatusCode `json:"statusCode"`+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus404JSONResponseBodyStatusCode `json:"statusCode"`}// JSON422 the response for an HTTP 422 `application/json` responseJSON422 *struct {- Error string `json:"error"`- Message interface{} `json:"message,omitempty"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus422JSONResponseBodyStatusCode `json:"statusCode"`+ Error string `json:"error"`+ Message interface{} `json:"message,omitempty"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus422JSONResponseBodyStatusCode `json:"statusCode"`}// JSON500 the response for an HTTP 500 `application/json` responseJSON500 *struct {- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus500JSONResponseBodyStatusCode `json:"statusCode"`+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus500JSONResponseBodyStatusCode `json:"statusCode"`}}// GetJSON200 returns the response for an HTTP 200 `application/json` response-func (r GetServerStatusResponse) GetJSON200() *struct {+func (r GetInstanceStatusResponse) GetJSON200() *struct {AuditLogStorageDisabled *bool `json:"auditLogStorageDisabled,omitempty"`Date time.Time `json:"date"`EmailConfigured *bool `json:"emailConfigured,omitempty"`@@ -12449,74 +12455,74 @@ func (r GetServerStatusResponse) GetJSON200() *struct {}// GetJSON400 returns the response for an HTTP 400 `application/json` response-func (r GetServerStatusResponse) GetJSON400() *struct {- Details interface{} `json:"details,omitempty"`- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus400JSONResponseBodyStatusCode `json:"statusCode"`+func (r GetInstanceStatusResponse) GetJSON400() *struct {+ Details interface{} `json:"details,omitempty"`+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus400JSONResponseBodyStatusCode `json:"statusCode"`} {return r.JSON400}// GetJSON401 returns the response for an HTTP 401 `application/json` response-func (r GetServerStatusResponse) GetJSON401() *struct {- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus401JSONResponseBodyStatusCode `json:"statusCode"`+func (r GetInstanceStatusResponse) GetJSON401() *struct {+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus401JSONResponseBodyStatusCode `json:"statusCode"`} {return r.JSON401}// GetJSON403 returns the response for an HTTP 403 `application/json` response-func (r GetServerStatusResponse) GetJSON403() *struct {- Details interface{} `json:"details,omitempty"`- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus403JSONResponseBodyStatusCode `json:"statusCode"`+func (r GetInstanceStatusResponse) GetJSON403() *struct {+ Details interface{} `json:"details,omitempty"`+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus403JSONResponseBodyStatusCode `json:"statusCode"`} {return r.JSON403}// GetJSON404 returns the response for an HTTP 404 `application/json` response-func (r GetServerStatusResponse) GetJSON404() *struct {- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus404JSONResponseBodyStatusCode `json:"statusCode"`+func (r GetInstanceStatusResponse) GetJSON404() *struct {+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus404JSONResponseBodyStatusCode `json:"statusCode"`} {return r.JSON404}// GetJSON422 returns the response for an HTTP 422 `application/json` response-func (r GetServerStatusResponse) GetJSON422() *struct {- Error string `json:"error"`- Message interface{} `json:"message,omitempty"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus422JSONResponseBodyStatusCode `json:"statusCode"`+func (r GetInstanceStatusResponse) GetJSON422() *struct {+ Error string `json:"error"`+ Message interface{} `json:"message,omitempty"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus422JSONResponseBodyStatusCode `json:"statusCode"`} {return r.JSON422}// GetJSON500 returns the response for an HTTP 500 `application/json` response-func (r GetServerStatusResponse) GetJSON500() *struct {- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus500JSONResponseBodyStatusCode `json:"statusCode"`+func (r GetInstanceStatusResponse) GetJSON500() *struct {+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus500JSONResponseBodyStatusCode `json:"statusCode"`} {return r.JSON500}// GetBody returns the raw response body bytes-func (r GetServerStatusResponse) GetBody() []byte {+func (r GetInstanceStatusResponse) GetBody() []byte {return r.Body}// Status returns HTTPResponse.Status-func (r GetServerStatusResponse) Status() string {+func (r GetInstanceStatusResponse) Status() string {if r.HTTPResponse != nil {return r.HTTPResponse.Status}@@ -12524,7 +12530,7 @@ func (r GetServerStatusResponse) Status() string {}// StatusCode returns HTTPResponse.StatusCode-func (r GetServerStatusResponse) StatusCode() int {+func (r GetInstanceStatusResponse) StatusCode() int {if r.HTTPResponse != nil {return r.HTTPResponse.StatusCode}@@ -12532,7 +12538,7 @@ func (r GetServerStatusResponse) StatusCode() int {}// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers-func (r GetServerStatusResponse) ContentType() string {+func (r GetInstanceStatusResponse) ContentType() string {if r.HTTPResponse != nil {return r.HTTPResponse.Header.Get("Content-Type")}@@ -18861,15 +18867,17 @@ func (r CreateSecretV4Response) ContentType() string {return ""}-// GetServerStatusWithResponse performs a GET /api/status (the `GetServerStatus` operationId) request.+// GetInstanceStatusWithResponse performs a GET /api/status (the `GetInstanceStatus` operationId) request.+//+// Get the status of the Infisical instance and the features configured on it. Public and unauthenticated; used by liveness and readiness probes and exempt from the API-wide rate limit.//// Returns a wrapper object for the known response body format(s).-func (c *ClientWithResponses) GetServerStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetServerStatusResponse, error) {- rsp, err := c.GetServerStatus(ctx, reqEditors...)+func (c *ClientWithResponses) GetInstanceStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetInstanceStatusResponse, error) {+ rsp, err := c.GetInstanceStatus(ctx, reqEditors...)if err != nil {return nil, err}- return ParseGetServerStatusResponse(rsp)+ return ParseGetInstanceStatusResponse(rsp)}// AdminBootstrapWithBodyWithResponse performs a POST /api/v1/admin/bootstrap (the `AdminBootstrap` operationId) request,@@ -19541,15 +19549,15 @@ func (c *ClientWithResponses) CreateSecretV4WithResponse(ctx context.Context, sereturn ParseCreateSecretV4Response(rsp)}-// ParseGetServerStatusResponse parses an HTTP response from a GetServerStatusWithResponse call-func ParseGetServerStatusResponse(rsp *http.Response) (*GetServerStatusResponse, error) {+// ParseGetInstanceStatusResponse parses an HTTP response from a GetInstanceStatusWithResponse call+func ParseGetInstanceStatusResponse(rsp *http.Response) (*GetInstanceStatusResponse, error) {bodyBytes, err := io.ReadAll(rsp.Body)defer func() { _ = rsp.Body.Close() }()if err != nil {return nil, err}- response := &GetServerStatusResponse{+ response := &GetInstanceStatusResponse{Body: bodyBytes,HTTPResponse: rsp,}@@ -19574,11 +19582,11 @@ func ParseGetServerStatusResponse(rsp *http.Response) (*GetServerStatusResponse,case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:var dest struct {- Details interface{} `json:"details,omitempty"`- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus400JSONResponseBodyStatusCode `json:"statusCode"`+ Details interface{} `json:"details,omitempty"`+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus400JSONResponseBodyStatusCode `json:"statusCode"`}if err := json.Unmarshal(bodyBytes, &dest); err != nil {return nil, err@@ -19587,10 +19595,10 @@ func ParseGetServerStatusResponse(rsp *http.Response) (*GetServerStatusResponse,case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:var dest struct {- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus401JSONResponseBodyStatusCode `json:"statusCode"`+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus401JSONResponseBodyStatusCode `json:"statusCode"`}if err := json.Unmarshal(bodyBytes, &dest); err != nil {return nil, err@@ -19599,11 +19607,11 @@ func ParseGetServerStatusResponse(rsp *http.Response) (*GetServerStatusResponse,case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:var dest struct {- Details interface{} `json:"details,omitempty"`- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus403JSONResponseBodyStatusCode `json:"statusCode"`+ Details interface{} `json:"details,omitempty"`+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus403JSONResponseBodyStatusCode `json:"statusCode"`}if err := json.Unmarshal(bodyBytes, &dest); err != nil {return nil, err@@ -19612,10 +19620,10 @@ func ParseGetServerStatusResponse(rsp *http.Response) (*GetServerStatusResponse,case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:var dest struct {- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus404JSONResponseBodyStatusCode `json:"statusCode"`+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus404JSONResponseBodyStatusCode `json:"statusCode"`}if err := json.Unmarshal(bodyBytes, &dest); err != nil {return nil, err@@ -19624,10 +19632,10 @@ func ParseGetServerStatusResponse(rsp *http.Response) (*GetServerStatusResponse,case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422:var dest struct {- Error string `json:"error"`- Message interface{} `json:"message,omitempty"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus422JSONResponseBodyStatusCode `json:"statusCode"`+ Error string `json:"error"`+ Message interface{} `json:"message,omitempty"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus422JSONResponseBodyStatusCode `json:"statusCode"`}if err := json.Unmarshal(bodyBytes, &dest); err != nil {return nil, err@@ -19636,10 +19644,10 @@ func ParseGetServerStatusResponse(rsp *http.Response) (*GetServerStatusResponse,case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:var dest struct {- Error string `json:"error"`- Message string `json:"message"`- ReqId string `json:"reqId"`- StatusCode GetServerStatus500JSONResponseBodyStatusCode `json:"statusCode"`+ Error string `json:"error"`+ Message string `json:"message"`+ ReqId string `json:"reqId"`+ StatusCode GetInstanceStatus500JSONResponseBodyStatusCode `json:"statusCode"`}if err := json.Unmarshal(bodyBytes, &dest); err != nil {return nil, errdiff --git a/tests/clients/api/oapi-codegen.yaml b/tests/clients/api/oapi-codegen.yamlindex 53943183d2..ae68c78306 100644--- a/tests/clients/api/oapi-codegen.yaml+++ b/tests/clients/api/oapi-codegen.yaml@@ -18,7 +18,7 @@ output-options:include-operation-ids:- adminBootstrap- updateAdminConfig- - getServerStatus+ - getInstanceStatus- loginV3- selectOrganizationV3- refreshAuthTokendiff --git a/tests/harness/harness.go b/tests/harness/harness.goindex 308f31bcce..26a17d1445 100644--- a/tests/harness/harness.go+++ b/tests/harness/harness.go@@ -40,8 +40,9 @@ type Stack struct {app *infisical.Handleroot infisical.Root- // defaultPlan is what a tenant gets unless it asks for something narrower.- defaultPlan license.Plan+ // defaultPlan is what a tenant gets unless it asks for something narrower. Nil+ // leaves the license fake's own default, Enterprise.+ defaultPlan *license.PlanadminOnce sync.OnceinstanceAdmin *Principal@@ -52,7 +53,7 @@ type Option func(*config)type config struct {extra []infra.Module- plan license.Plan+ plan *license.Plan}// WithInfra adds a container the harness does not know about, for a suite that needs@@ -63,14 +64,14 @@ func WithInfra(mods ...infra.Module) Option {// WithDefaultPlan sets the entitlements a tenant gets unless it asks for others.func WithDefaultPlan(p license.Plan) Option {- return func(c *config) { c.plan = p }+ return func(c *config) { c.plan = &p }}// Main brings the stack up, runs the package's tests, and tears down what it owns.//// It calls os.Exit, so it never returns.func Main(m *testing.M, profile Profile, opts ...Option) {- cfg := &config{plan: license.Enterprise()}+ cfg := &config{}for _, o := range opts {o(cfg)}@@ -112,7 +113,7 @@ func run(m *testing.M, profile Profile, cfg *config, mainFile string) (int, erro// instead of racing to create it. Everything it starts is shared, so nothing here// owns a container: only `inf down` stops them.func Up(ctx context.Context) error {- _, owned, err := bringUp(ctx, Shared, &config{plan: license.Enterprise()}, "")+ _, owned, err := bringUp(ctx, Shared, &config{}, "")if err != nil {return err}@@ -147,7 +148,15 @@ func bringUp(ctx context.Context, profile Profile, cfg *config, pkg string) (*St// fakenet; a CA minted per boot would leave the running Infisical trusting an// authority that no longer exists.caFile := filepath.Join(root, "tests", fakenet.CAFile)- if _, err = fakenet.LoadOrCreateCA(caFile); err != nil {+ // Serialized because every package binary starts here at once, and two that each+ // found no file would write different CAs.+ releaseCA, err := infra.Lock("fakenet-ca")+ if err != nil {+ return nil, nil, err+ }+ _, err = fakenet.LoadOrCreateCA(caFile)+ releaseCA()+ if err != nil {return nil, nil, err}diff --git a/tests/harness/infisical/infisical.go b/tests/harness/infisical/infisical.goindex b73d4fc7c2..9be8890d3d 100644--- a/tests/harness/infisical/infisical.go+++ b/tests/harness/infisical/infisical.go@@ -198,7 +198,7 @@ func (h *Handle) Status(ctx context.Context) (Status, error) {if err != nil {return Status{}, err}- res, err := c.GetServerStatusWithResponse(ctx)+ res, err := c.GetInstanceStatusWithResponse(ctx)if err != nil {return Status{}, fmt.Errorf("infisical: reading status: %w", err)}diff --git a/tests/harness/tenant.go b/tests/harness/tenant.goindex 796b6db938..758ee3a9ce 100644--- a/tests/harness/tenant.go+++ b/tests/harness/tenant.go@@ -109,7 +109,7 @@ func WithPlan(p license.Plan) TenantOption { return func(c *tenantConfig) { c.plfunc (s *Stack) NewTenant(t *testing.T, opts ...TenantOption) *Tenant {t.Helper()- cfg := tenantConfig{name: "t-" + strings.ToLower(uuid.NewString()[:8])}+ cfg := tenantConfig{name: "t-" + strings.ToLower(uuid.NewString()[:8]), plan: s.defaultPlan}for _, o := range opts {o(&cfg)}diff --git a/tests/infra/fakenet/ca.go b/tests/infra/fakenet/ca.goindex 9bc57b3443..0c6bf16033 100644--- a/tests/infra/fakenet/ca.go+++ b/tests/infra/fakenet/ca.go@@ -53,15 +53,37 @@ func LoadOrCreateCA(path string) (*CA, error) {if err != nil {return nil, err}- if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {- return nil, err- }- if err := os.WriteFile(path, append(append([]byte{}, ca.pem...), keyPEM...), 0o600); err != nil {+ if err := writeAtomically(path, append(append([]byte{}, ca.pem...), keyPEM...)); err != nil {return nil, fmt.Errorf("fakenet: writing CA to %s: %w", path, err)}return ca, nil}+// writeAtomically renames a finished file into place, so a reader never sees a+// partly written CA and mistakes it for a corrupt one.+func writeAtomically(path string, data []byte) error {+ if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {+ return err+ }+ tmp, err := os.CreateTemp(filepath.Dir(path), filepath.Base(path)+".*.tmp")+ if err != nil {+ return err+ }+ defer func() { _ = os.Remove(tmp.Name()) }()+ if _, err := tmp.Write(data); err != nil {+ _ = tmp.Close()+ return err+ }+ if err := tmp.Chmod(0o600); err != nil {+ _ = tmp.Close()+ return err+ }+ if err := tmp.Close(); err != nil {+ return err+ }+ return os.Rename(tmp.Name(), path)+}+func newCA() (*CA, []byte, error) {key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)if err != nil {diff --git a/tests/infra/runner.go b/tests/infra/runner.goindex 139ebefc9c..ab4744c67a 100644--- a/tests/infra/runner.go+++ b/tests/infra/runner.go@@ -276,7 +276,9 @@ func (r *dockerRunner) Run(ctx context.Context, spec ContainerSpec) (Container,if spec.Check != nil {if err := spec.Check(ctx, c); err != nil {- return c, fmt.Errorf("infra: %s came up but is not usable: %w", spec.Name, err)+ // Left running, the next run would adopt it by name and fail the same way.+ _ = c.Stop(context.WithoutCancel(ctx))+ return Container{}, fmt.Errorf("infra: %s came up but is not usable: %w", spec.Name, err)}}