From 94a8f68f5394bb4f7f68e88f016ed5ba6687110e Mon Sep 17 00:00:00 2001 From: Francisc Munteanu Date: Tue, 28 Nov 2023 23:47:05 +0100 Subject: [PATCH 1/3] add automatic verification threshold field --- api/v1alpha1/toolchainconfig_types.go | 5 +++++ api/v1alpha1/zz_generated.deepcopy.go | 5 +++++ api/v1alpha1/zz_generated.openapi.go | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/api/v1alpha1/toolchainconfig_types.go b/api/v1alpha1/toolchainconfig_types.go index ab5c90ee..4490eca3 100644 --- a/api/v1alpha1/toolchainconfig_types.go +++ b/api/v1alpha1/toolchainconfig_types.go @@ -441,6 +441,11 @@ type CaptchaConfig struct { // +optional ScoreThreshold *string `json:"scoreThreshold,omitempty"` + // AutomaticVerificationThreshold defines the lowest captcha score for automatic approval to be enabled. + // If the captcha score is below this threshold then manual approval is required in order for the user to be provisioned. + // +optional + AutomaticVerificationThreshold *string `json:"automaticVerificationThreshold,omitempty"` + // SiteKey defines the recaptcha site key to use when making recaptcha requests. There can be different ones for different environments. eg. dev, stage, prod // +optional SiteKey *string `json:"siteKey,omitempty"` diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index a89912c6..9f1f5fb4 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -228,6 +228,11 @@ func (in *CaptchaConfig) DeepCopyInto(out *CaptchaConfig) { *out = new(string) **out = **in } + if in.AutomaticVerificationThreshold != nil { + in, out := &in.AutomaticVerificationThreshold, &out.AutomaticVerificationThreshold + *out = new(string) + **out = **in + } if in.SiteKey != nil { in, out := &in.SiteKey, &out.SiteKey *out = new(string) diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index 32d6121f..f43cd2ec 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -428,6 +428,13 @@ func schema_codeready_toolchain_api_api_v1alpha1_CaptchaConfig(ref common.Refere Format: "", }, }, + "automaticVerificationThreshold": { + SchemaProps: spec.SchemaProps{ + Description: "AutomaticVerificationThreshold defines the lowest captcha score for automatic approval to be enabled. If the captcha score is below this threshold then manual approval is required in order for the user to be provisioned.", + Type: []string{"string"}, + Format: "", + }, + }, "siteKey": { SchemaProps: spec.SchemaProps{ Description: "SiteKey defines the recaptcha site key to use when making recaptcha requests. There can be different ones for different environments. eg. dev, stage, prod", From baa8ab5baf236208e35f90e5ecfe2f8838ba0cc5 Mon Sep 17 00:00:00 2001 From: Francisc Munteanu Date: Wed, 29 Nov 2023 10:03:05 +0100 Subject: [PATCH 2/3] add allowLowScoreReactivation field --- api/v1alpha1/toolchainconfig_types.go | 4 ++++ api/v1alpha1/zz_generated.deepcopy.go | 5 +++++ api/v1alpha1/zz_generated.openapi.go | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/api/v1alpha1/toolchainconfig_types.go b/api/v1alpha1/toolchainconfig_types.go index 4490eca3..786434f3 100644 --- a/api/v1alpha1/toolchainconfig_types.go +++ b/api/v1alpha1/toolchainconfig_types.go @@ -446,6 +446,10 @@ type CaptchaConfig struct { // +optional AutomaticVerificationThreshold *string `json:"automaticVerificationThreshold,omitempty"` + // AllowLowScoreReactivation specifies whether the reactivation for users with low captcha score (below AutomaticVerificationThreshold) is enabled without the need for manual approval. + // +optional + AllowLowScoreReactivation *bool `json:"allowLowScoreReactivation,omitempty"` + // SiteKey defines the recaptcha site key to use when making recaptcha requests. There can be different ones for different environments. eg. dev, stage, prod // +optional SiteKey *string `json:"siteKey,omitempty"` diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 9f1f5fb4..73c19f6c 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -233,6 +233,11 @@ func (in *CaptchaConfig) DeepCopyInto(out *CaptchaConfig) { *out = new(string) **out = **in } + if in.AllowLowScoreReactivation != nil { + in, out := &in.AllowLowScoreReactivation, &out.AllowLowScoreReactivation + *out = new(bool) + **out = **in + } if in.SiteKey != nil { in, out := &in.SiteKey, &out.SiteKey *out = new(string) diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index f43cd2ec..fd59d7b7 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -435,6 +435,13 @@ func schema_codeready_toolchain_api_api_v1alpha1_CaptchaConfig(ref common.Refere Format: "", }, }, + "allowLowScoreReactivation": { + SchemaProps: spec.SchemaProps{ + Description: "AllowLowScoreReactivation specifies whether the reactivation for users with low captcha score (below AutomaticVerificationThreshold) is enabled without the need for manual approval.", + Type: []string{"boolean"}, + Format: "", + }, + }, "siteKey": { SchemaProps: spec.SchemaProps{ Description: "SiteKey defines the recaptcha site key to use when making recaptcha requests. There can be different ones for different environments. eg. dev, stage, prod", From 9247ee8fe6b173cd1a31f719240624775ae31b4a Mon Sep 17 00:00:00 2001 From: Francisc Munteanu Date: Wed, 29 Nov 2023 10:20:23 +0100 Subject: [PATCH 3/3] rename to RequiredScore --- api/v1alpha1/toolchainconfig_types.go | 8 ++++---- api/v1alpha1/zz_generated.deepcopy.go | 4 ++-- api/v1alpha1/zz_generated.openapi.go | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api/v1alpha1/toolchainconfig_types.go b/api/v1alpha1/toolchainconfig_types.go index 786434f3..c7843da7 100644 --- a/api/v1alpha1/toolchainconfig_types.go +++ b/api/v1alpha1/toolchainconfig_types.go @@ -441,12 +441,12 @@ type CaptchaConfig struct { // +optional ScoreThreshold *string `json:"scoreThreshold,omitempty"` - // AutomaticVerificationThreshold defines the lowest captcha score for automatic approval to be enabled. - // If the captcha score is below this threshold then manual approval is required in order for the user to be provisioned. + // RequiredScore defines the lowest captcha score, below this score the user cannot proceed with the signup process at all. + // Users with captcha score lower than the required one can still be approved manually. // +optional - AutomaticVerificationThreshold *string `json:"automaticVerificationThreshold,omitempty"` + RequiredScore *string `json:"requiredScore,omitempty"` - // AllowLowScoreReactivation specifies whether the reactivation for users with low captcha score (below AutomaticVerificationThreshold) is enabled without the need for manual approval. + // AllowLowScoreReactivation specifies whether the reactivation for users with low captcha score (below the RequiredScore) is enabled without the need for manual approval. // +optional AllowLowScoreReactivation *bool `json:"allowLowScoreReactivation,omitempty"` diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 73c19f6c..1c8f2ccf 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -228,8 +228,8 @@ func (in *CaptchaConfig) DeepCopyInto(out *CaptchaConfig) { *out = new(string) **out = **in } - if in.AutomaticVerificationThreshold != nil { - in, out := &in.AutomaticVerificationThreshold, &out.AutomaticVerificationThreshold + if in.RequiredScore != nil { + in, out := &in.RequiredScore, &out.RequiredScore *out = new(string) **out = **in } diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index fd59d7b7..c0c71071 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -428,16 +428,16 @@ func schema_codeready_toolchain_api_api_v1alpha1_CaptchaConfig(ref common.Refere Format: "", }, }, - "automaticVerificationThreshold": { + "requiredScore": { SchemaProps: spec.SchemaProps{ - Description: "AutomaticVerificationThreshold defines the lowest captcha score for automatic approval to be enabled. If the captcha score is below this threshold then manual approval is required in order for the user to be provisioned.", + Description: "RequiredScore defines the lowest captcha score, below this score the user cannot proceed with the signup process at all. Users with captcha score lower than the required one can still be approved manually.", Type: []string{"string"}, Format: "", }, }, "allowLowScoreReactivation": { SchemaProps: spec.SchemaProps{ - Description: "AllowLowScoreReactivation specifies whether the reactivation for users with low captcha score (below AutomaticVerificationThreshold) is enabled without the need for manual approval.", + Description: "AllowLowScoreReactivation specifies whether the reactivation for users with low captcha score (below the RequiredScore) is enabled without the need for manual approval.", Type: []string{"boolean"}, Format: "", },