-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(pci-kubernetes): kubernetes OIDC add optional fields #14523
base: develop
Are you sure you want to change the base?
feat(pci-kubernetes): kubernetes OIDC add optional fields #14523
Conversation
"pci_projects_project_kubernetes_details_service_update_oidc_provider_action_update": "Modifier", | ||
"pci_projects_project_kubernetes_details_service_update_oidc_provider_action_cancel": "Annuler", | ||
"pci_projects_project_kubernetes_details_service_update_oidc_provider_field_url": "Provider URL (Obligatoire)", | ||
"pci_projects_project_kubernetes_details_service_update_oidc_provider_field_url_extra": "Saisissez ici l'URL de discovery de votre fournisseur, sans path. L'URL doit pointer vers le niveau précédent .well-known/openid-configuration . Vous devez utiliser une URL débutant par https://", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"pci_projects_project_kubernetes_details_service_update_oidc_provider_field_url_extra": "Saisissez ici l'URL de discovery de votre fournisseur, sans path. L'URL doit pointer vers le niveau précédent .well-known/openid-configuration . Vous devez utiliser une URL débutant par https://", | |
"pci_projects_project_kubernetes_details_service_update_oidc_provider_field_url_extra": "Saisissez ici l'URL de discovery de votre fournisseur, sans path. L'URL doit pointer vers le niveau précédent .well-known/openid-configuration . Vous devez utiliser une URL commençant par https://", |
"pci_projects_project_kubernetes_details_service_hide_optional": "Voir moins d’options", | ||
"pci_projects_project_kubernetes_details_service_oidc_provider_field_ca_content_error": "Le champ caContent doit être une chaîne valide en Base64.", | ||
"pci_projects_project_kubernetes_details_service_oidc_provider_field_required_claim_error": "Le champ requiredClaim doit être au format 'clé=valeur'.", | ||
"pci_projects_project_kubernetes_details_service_oidc_provider_field_groups_claim_caption": "Ajouter plusieurs valeurs séparées par des virgules, exemple : valeur1, valeur2.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"pci_projects_project_kubernetes_details_service_oidc_provider_field_groups_claim_caption": "Ajouter plusieurs valeurs séparées par des virgules, exemple : valeur1, valeur2.", | |
"pci_projects_project_kubernetes_details_service_oidc_provider_field_groups_claim_caption": "Ajoutez plusieurs valeurs en les séparant par des virgules, par exemple : group1, group2", |
"pci_projects_project_kubernetes_details_service_oidc_provider_field_ca_content_error": "Le champ caContent doit être une chaîne valide en Base64.", | ||
"pci_projects_project_kubernetes_details_service_oidc_provider_field_required_claim_error": "Le champ requiredClaim doit être au format 'clé=valeur'.", | ||
"pci_projects_project_kubernetes_details_service_oidc_provider_field_groups_claim_caption": "Ajouter plusieurs valeurs séparées par des virgules, exemple : valeur1, valeur2.", | ||
"pci_projects_project_kubernetes_details_service_oidc_provider_field_required_claim_caption": "Ajouter plusieurs valeurs séparées par des virgules, exemple : clé1=valeur1, clé2=valeur2.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"pci_projects_project_kubernetes_details_service_oidc_provider_field_required_claim_caption": "Ajouter plusieurs valeurs séparées par des virgules, exemple : clé1=valeur1, clé2=valeur2.", | |
"pci_projects_project_kubernetes_details_service_oidc_provider_field_required_claim_caption": "Ajoutez plusieurs valeurs en les séparant par des virgules, par exemple : role=admin, environment=production", |
"pci_projects_project_kubernetes_details_service_show_optional": "Configuration optionnelle", | ||
"pci_projects_project_kubernetes_details_service_hide_optional": "Voir moins d’options", | ||
"pci_projects_project_kubernetes_details_service_oidc_provider_field_ca_content_error": "Le champ caContent doit être une chaîne valide en Base64.", | ||
"pci_projects_project_kubernetes_details_service_oidc_provider_field_required_claim_error": "Le champ requiredClaim doit être au format 'clé=valeur'.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a error case if customer doesn't use "," as separator.
Le champ requiredClaim doit contenir une liste de valeurs séparées par des virgules, par exemple :role=admin, environment=production
"pci_projects_project_kubernetes_details_service_oidc_provider_field_required_claim_error": "Le champ requiredClaim doit être au format 'clé=valeur'.", | ||
"pci_projects_project_kubernetes_details_service_oidc_provider_field_groups_claim_caption": "Ajouter plusieurs valeurs séparées par des virgules, exemple : valeur1, valeur2.", | ||
"pci_projects_project_kubernetes_details_service_oidc_provider_field_required_claim_caption": "Ajouter plusieurs valeurs séparées par des virgules, exemple : clé1=valeur1, clé2=valeur2.", | ||
"pci_projects_project_kubernetes_details_service_oidc_provider_field_groups_claim_error": "Le champ groupsClaim doit contenir une liste de valeurs séparées par des virgules." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"pci_projects_project_kubernetes_details_service_oidc_provider_field_groups_claim_error": "Le champ groupsClaim doit contenir une liste de valeurs séparées par des virgules." | |
"pci_projects_project_kubernetes_details_service_oidc_provider_field_groups_claim_error": "Le champ groupsClaim doit contenir une liste de valeurs séparées par des virgules, par exemple : group1, group2" |
}); | ||
}); | ||
}); | ||
// import { describe, it, vi } from 'vitest'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I see, this file should be removed.
// Fonction pour vérifier si une chaîne est une chaîne Base64 valide | ||
function isBase64(str: string) { | ||
try { | ||
return btoa(atob(str)) === str; | ||
} catch (err) { | ||
return false; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are multiple issues here:
- we shouldn't declare any logical function into a
types
folder - the comment is in French
- there is no test associated
export const camelToSnake = (camelCase: string): string => | ||
camelCase.replace(/([A-Z])/g, '_$1').toLowerCase(); | ||
|
||
export const filterSchemaKeys = (schema, excludeKeys) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing type parameters
Object.keys(schema.shape).filter((key) => !excludeKeys.includes(key)); | ||
|
||
export const parseCommaSeparated = ( | ||
value: string | string[] | undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value: string | string[] | undefined, | |
value?: string | string[], |
.map((item) => item.trim()) | ||
.filter(Boolean); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant with the function line 136, please make a dedicated function
'upsert-oidc-provider', | ||
'add-oidc-provider', | ||
'update-oidc-provider', | ||
// 'upsert-oidc-provider', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be removed
upsertOidcProvider(data); | ||
const fields = useFormFields(); | ||
|
||
const onSubmit = (data: TOidcFormValues) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap into a useCallback
as upsertOidcProvider
depends on a hook call
variant={ODS_BUTTON_VARIANT.ghost} | ||
onClick={onClose} | ||
data-testid={`${mode}-oidc-provider:${mode}OIDCProvider-button_cancel`} | ||
<OsdsText |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of redundancies in these elements, please think to refactor code using high level functions and/or React.CloneELement to prevent from rewriting the same things with different props.
import React, { FormEvent } from 'react'; | ||
import { OsdsTextarea } from '@ovhcloud/ods-components/react'; | ||
|
||
export type TtextAreaFormFieldProps = React.ComponentProps< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export type TtextAreaFormFieldProps = React.ComponentProps< | |
export type TTextAreaFormFieldProps = React.ComponentProps< |
const useFormFields = () => { | ||
const { t } = useTranslation('oidc-provider'); | ||
|
||
const fields = useMemo(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const fields = useMemo(() => { | |
return useMemo(() => { |
f7d4b3e
to
c5b2e5d
Compare
c5b2e5d
to
42106df
Compare
@@ -1,4 +1,3 @@ | |||
import { ResponseAPIError } from '@ovh-ux/manager-pci-common'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this is still used (line 85-86)
7bac475
to
7839844
Compare
ref: TAPC-2088 Signed-off-by: Eric Ciccotti <[email protected]>
ref: TAPC-2088 Signed-off-by: Eric Ciccotti <[email protected]>
ref: TAPC-34 Signed-off-by: Eric Ciccotti <[email protected]>
ref: TAPC-34 Signed-off-by: Eric Ciccotti <[email protected]>
7839844
to
181e6f8
Compare
ref: TAPC-34 Signed-off-by: Eric Ciccotti <[email protected]>
Signed-off-by: CDS Translator Agent <[email protected]>
Quality Gate passedIssues Measures |
develop
Description
This PR add optional fields for kubernetes OIDC provider
Related