From b6f17d91989515d718a6b4a325dd4d885e211db3 Mon Sep 17 00:00:00 2001 From: fmuntean Date: Thu, 28 May 2026 09:25:11 +0200 Subject: [PATCH] make account verifier flag enum --- api/v1alpha1/docs/apiref.adoc | 5 ++++- api/v1alpha1/toolchainconfig_types.go | 7 +++++-- api/v1alpha1/zz_generated.deepcopy.go | 6 +++--- api/v1alpha1/zz_generated.openapi.go | 6 +++--- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/api/v1alpha1/docs/apiref.adoc b/api/v1alpha1/docs/apiref.adoc index 40e3379e..784981d1 100644 --- a/api/v1alpha1/docs/apiref.adoc +++ b/api/v1alpha1/docs/apiref.adoc @@ -2139,7 +2139,10 @@ considered enabled. Only listed integrations are hidden. + | | Optional: \{} + | *`accountVerifierURL`* __string__ | AccountVerifierURL is the URL used to call the account verifier service + | | Optional: \{} + -| *`accountVerifierEnabled`* __boolean__ | AccountVerifierEnabled controls whether the registration service acts on responses from the account-verifier service. + | | Optional: \{} + +| *`accountVerifierMode`* __string__ | AccountVerifierMode controls how the registration service handles responses from the account-verifier service. + +Valid values are "disabled" (do not call the verifier), "log" (call but only log the response), + +and "enabled" (call and enforce the response). Defaults to "log". + | | Enum: [disabled log enabled] + +Optional: \{} + |=== diff --git a/api/v1alpha1/toolchainconfig_types.go b/api/v1alpha1/toolchainconfig_types.go index 8090f675..f4085901 100644 --- a/api/v1alpha1/toolchainconfig_types.go +++ b/api/v1alpha1/toolchainconfig_types.go @@ -262,9 +262,12 @@ type RegistrationServiceConfig struct { // +optional AccountVerifierURL *string `json:"accountVerifierURL,omitempty"` - // AccountVerifierEnabled controls whether the registration service acts on responses from the account-verifier service. + // AccountVerifierMode controls how the registration service handles responses from the account-verifier service. + // Valid values are "disabled" (do not call the verifier), "log" (call but only log the response), + // and "enabled" (call and enforce the response). Defaults to "log". // +optional - AccountVerifierEnabled *bool `json:"accountVerifierEnabled,omitempty"` + // +kubebuilder:validation:Enum=disabled;log;enabled + AccountVerifierMode *string `json:"accountVerifierMode,omitempty"` } // RegistrationServiceAnalyticsConfig contains the subset of registration service configuration parameters related to analytics diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index b7e2d92d..49d72051 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1937,9 +1937,9 @@ func (in *RegistrationServiceConfig) DeepCopyInto(out *RegistrationServiceConfig *out = new(string) **out = **in } - if in.AccountVerifierEnabled != nil { - in, out := &in.AccountVerifierEnabled, &out.AccountVerifierEnabled - *out = new(bool) + if in.AccountVerifierMode != nil { + in, out := &in.AccountVerifierMode, &out.AccountVerifierMode + *out = new(string) **out = **in } } diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index 467e765a..132853c2 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -2658,10 +2658,10 @@ func schema_codeready_toolchain_api_api_v1alpha1_RegistrationServiceConfig(ref c Format: "", }, }, - "accountVerifierEnabled": { + "accountVerifierMode": { SchemaProps: spec.SchemaProps{ - Description: "AccountVerifierEnabled controls whether the registration service acts on responses from the account-verifier service.", - Type: []string{"boolean"}, + Description: "AccountVerifierMode controls how the registration service handles responses from the account-verifier service. Valid values are \"disabled\" (do not call the verifier), \"log\" (call but only log the response), and \"enabled\" (call and enforce the response). Defaults to \"log\".", + Type: []string{"string"}, Format: "", }, },