Skip to content

Commit 0f4b43d

Browse files
authored
[backend/frontend] Fix localStrategy on force env (#15311)
1 parent 9139de7 commit 0f4b43d

23 files changed

Lines changed: 912 additions & 134 deletions

File tree

opencti-platform/opencti-front/lang/front/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,6 +2509,7 @@
25092509
"Live trigger": "Live-Trigger",
25102510
"Loading current message count...": "Laden der aktuellen Nachrichtenanzahl...",
25112511
"Local": "Lokal",
2512+
"Local authentication cannot be changed when authentication is managed by environment configuration": "Die lokale Authentifizierung kann nicht geändert werden, wenn die Authentifizierung über die Umgebungskonfiguration verwaltet wird",
25122513
"Local authentication cannot be disabled when no other authentication provider is enabled": "Die lokale Authentifizierung kann nicht deaktiviert werden, wenn kein anderer Authentifizierungsanbieter aktiviert ist",
25132514
"Local password policies": "Lokale Kennwortrichtlinien",
25142515
"Local settings": "Lokale Einstellungen",

opencti-platform/opencti-front/lang/front/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,6 +2509,7 @@
25092509
"Live trigger": "Live trigger",
25102510
"Loading current message count...": "Loading current message count...",
25112511
"Local": "Local",
2512+
"Local authentication cannot be changed when authentication is managed by environment configuration": "Local authentication cannot be changed when authentication is managed by environment configuration",
25122513
"Local authentication cannot be disabled when no other authentication provider is enabled": "Local authentication cannot be disabled when no other authentication provider is enabled",
25132514
"Local password policies": "Local password policies",
25142515
"Local settings": "Local settings",

opencti-platform/opencti-front/lang/front/es.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,9 +1928,9 @@
19281928
"Force reauthentication": "Forzar reautenticación",
19291929
"Forecast": "Previsión",
19301930
"Form": "Formulario",
1931+
"FORM": "FORMULARIO",
19311932
"Form intakes": "Formularios de ingesta",
19321933
"Form intakes | Ingestion | Data": "Formularios de ingesta | Ingestión | Datos",
1933-
"FORM": "FORMULARIO",
19341934
"Form not found": "Formulario no encontrado",
19351935
"Form schema in JSON format": "Esquema del formulario en formato JSON",
19361936
"Form schema is required": "Se requiere esquema de formulario",
@@ -2509,6 +2509,7 @@
25092509
"Live trigger": "Disparador en vivo",
25102510
"Loading current message count...": "Cargando recuento de mensajes actual...",
25112511
"Local": "Local",
2512+
"Local authentication cannot be changed when authentication is managed by environment configuration": "La autenticación local no puede modificarse cuando la autenticación se gestiona mediante la configuración del entorno",
25122513
"Local authentication cannot be disabled when no other authentication provider is enabled": "La autenticación local no se puede deshabilitar cuando no hay otro proveedor de autenticación habilitado",
25132514
"Local password policies": "Políticas locales de contraseñas",
25142515
"Local settings": "Configuración local",
@@ -4844,8 +4845,8 @@
48444845
"You see only marking definitions that can be shared (defined by the admin)": "Sólo se ven las definiciones de marcado que se pueden compartir (definidas por el administrador)",
48454846
"You should activate EE to use this feature": "Debe activar EE para utilizar esta función",
48464847
"You should provide a variable name": "Debe proporcionar un nombre de variable",
4847-
"You will be able to revert this change if needed. ": "Podrá revertir este cambio si es necesario.",
48484848
"You were automatically logged out due to session expiration.": "Se ha cerrado automáticamente la sesión debido a la expiración de la misma.",
4849+
"You will be able to revert this change if needed. ": "Podrá revertir este cambio si es necesario.",
48494850
"You will be automatically logged out at end of the timer.": "Se cerrará la sesión automáticamente al final del temporizador.",
48504851
"You will find here the computed state.": "Aquí encontrará el estado calculado.",
48514852
"You will find here the result in JSON format.": "Aquí encontrará el resultado en formato JSON.",
@@ -4873,4 +4874,4 @@
48734874
"Zoom": "Zoom",
48744875
"Zoom in": "Ampliar",
48754876
"Zoom out": "Alejar"
4876-
}
4877+
}

opencti-platform/opencti-front/lang/front/fr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,6 +2509,7 @@
25092509
"Live trigger": "Déclencheur live",
25102510
"Loading current message count...": "Chargement du nombre de messages en cours...",
25112511
"Local": "Local",
2512+
"Local authentication cannot be changed when authentication is managed by environment configuration": "L'authentification locale ne peut pas être modifiée lorsque l'authentification est gérée par la configuration de l'environnement",
25122513
"Local authentication cannot be disabled when no other authentication provider is enabled": "L'authentification locale ne peut pas être désactivée lorsqu'aucun autre fournisseur d'authentification n'est activé",
25132514
"Local password policies": "Politiques locales en matière de mots de passe",
25142515
"Local settings": "Paramètres locaux",

opencti-platform/opencti-front/lang/front/it.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,6 +2509,7 @@
25092509
"Live trigger": "Trigger live",
25102510
"Loading current message count...": "Caricamento del numero di messaggi attuali...",
25112511
"Local": "Locale",
2512+
"Local authentication cannot be changed when authentication is managed by environment configuration": "L'autenticazione locale non può essere modificata quando l'autenticazione è gestita dalla configurazione dell'ambiente",
25122513
"Local authentication cannot be disabled when no other authentication provider is enabled": "L'autenticazione locale non può essere disabilitata se nessun altro provider di autenticazione è abilitato",
25132514
"Local password policies": "Politiche locali sulla password",
25142515
"Local settings": "Impostazioni locali",

opencti-platform/opencti-front/lang/front/ja.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,6 +2144,7 @@
21442144
"If you want to keep the associated information, we recommend deactivating the user instead.": "関連情報を保持したい場合は、代わりにユーザーを非アクティブ化することをお勧めします。",
21452145
"If your email address is found, an email will be sent to you.": "あなたのメールアドレスが見つかった場合、Eメールが送信されます。",
21462146
"if your service account has been created originally as a service account (not transformed), please also change the email of your service account before/after transforming it to a user to ensure that the future user will be able to receive an email in the forgot password workflow.": "サービスアカウントが元々サービスアカウントとして作成されている(変換されていない)場合、パスワード忘れワークフローで将来のユーザーが確実にメールを受信できるように、ユーザーへの変換前/後のサービスアカウントのメールも変更してください。",
2147+
"Image URL": "画像URL",
21472148
"IMEI values can only include digits, must be 15 to 16 characters": "IMEI値は数字のみで、15文字から16文字でなければなりません。",
21482149
"Impact": "衝撃",
21492150
"Impacted": "影響",
@@ -2508,6 +2509,7 @@
25082509
"Live trigger": "ライブトリガー",
25092510
"Loading current message count...": "現在のメッセージ数をロード中...",
25102511
"Local": "ローカル",
2512+
"Local authentication cannot be changed when authentication is managed by environment configuration": "認証が環境設定で管理されている場合、ローカル認証は変更できない",
25112513
"Local authentication cannot be disabled when no other authentication provider is enabled": "他の認証プロバイダーが有効になっていない場合、ローカル認証を無効にすることはできません",
25122514
"Local password policies": "ローカルパスワードポリシー",
25132515
"Local settings": "ローカル設定",

opencti-platform/opencti-front/lang/front/ko.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,6 +2509,7 @@
25092509
"Live trigger": "실시간 트리거",
25102510
"Loading current message count...": "현재 메시지 수 로드 중...",
25112511
"Local": "로컬",
2512+
"Local authentication cannot be changed when authentication is managed by environment configuration": "환경 구성으로 인증이 관리되는 경우 로컬 인증을 변경할 수 없습니다",
25122513
"Local authentication cannot be disabled when no other authentication provider is enabled": "다른 인증 공급자가 활성화되어 있지 않으면 로컬 인증을 비활성화할 수 없습니다",
25132514
"Local password policies": "로컬 비밀번호 정책",
25142515
"Local settings": "로컬 설정",

opencti-platform/opencti-front/lang/front/ru.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,6 +2509,7 @@
25092509
"Live trigger": "Живой триггер",
25102510
"Loading current message count...": "Загрузка текущего количества сообщений...",
25112511
"Local": "Локальный",
2512+
"Local authentication cannot be changed when authentication is managed by environment configuration": "Локальная аутентификация не может быть изменена, если аутентификация управляется конфигурацией среды",
25122513
"Local authentication cannot be disabled when no other authentication provider is enabled": "Локальная аутентификация не может быть отключена, если не включен другой провайдер аутентификации",
25132514
"Local password policies": "Локальные политики паролей",
25142515
"Local settings": "Локальные настройки",

opencti-platform/opencti-front/lang/front/zh.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,6 +2509,7 @@
25092509
"Live trigger": "实时触发器",
25102510
"Loading current message count...": "正在加载当前信息数...",
25112511
"Local": "本地",
2512+
"Local authentication cannot be changed when authentication is managed by environment configuration": "当身份验证由环境配置管理时,无法更改本地身份验证",
25122513
"Local authentication cannot be disabled when no other authentication provider is enabled": "当未启用其他身份验证提供程序时,无法禁用本地身份验证",
25132514
"Local password policies": "本地密码策略",
25142515
"Local settings": "本地设置",

opencti-platform/opencti-front/src/private/components/settings/sso_definitions/LocalStrategyForm.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const localStrategyFormQuery = graphql`
4242
enabled
4343
}
4444
platform_https_enabled
45+
is_authentication_by_env
4546
}
4647
}
4748
`;
@@ -86,6 +87,7 @@ const LocalStrategyForm = ({ onCancel }: LocalStrategyFormProps) => {
8687
const theme = useTheme<Theme>();
8788
const data = useLazyLoadQuery<LocalStrategyFormQuery>(localStrategyFormQuery, {});
8889
const settings = data.settings;
90+
const isConfigurationFromEnv = settings.is_authentication_by_env ?? false;
8991

9092
const [commitMutation] = useApiMutation<LocalStrategyFormMutation>(
9193
localStrategyFormMutation,
@@ -159,8 +161,13 @@ const LocalStrategyForm = ({ onCancel }: LocalStrategyFormProps) => {
159161
type="checkbox"
160162
name="enabled"
161163
label={t_i18n('Enable local authentication')}
162-
disabled={!canDisableLocal && initialValues.enabled}
164+
disabled={isConfigurationFromEnv || (!canDisableLocal && initialValues.enabled)}
163165
/>
166+
{isConfigurationFromEnv && (
167+
<Tooltip title={t_i18n('Local authentication cannot be changed when authentication is managed by environment configuration')}>
168+
<InfoOutlined fontSize="small" color="primary" sx={{ ml: 1, cursor: 'default' }} />
169+
</Tooltip>
170+
)}
164171
{!canDisableLocal && initialValues.enabled && (
165172
<Tooltip title={t_i18n('Local authentication cannot be disabled when no other authentication provider is enabled')}>
166173
<InfoOutlined fontSize="small" color="primary" sx={{ ml: 1, cursor: 'default' }} />

0 commit comments

Comments
 (0)