Skip to content

Commit 4eee303

Browse files
authored
[backend/frontend] Fix localStrategy on force env (#15311)
1 parent bfc318a commit 4eee303

23 files changed

Lines changed: 942 additions & 138 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
@@ -2492,6 +2492,7 @@
24922492
"Live trigger": "Live-Trigger",
24932493
"Loading current message count...": "Laden der aktuellen Nachrichtenanzahl...",
24942494
"Local": "Lokal",
2495+
"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",
24952496
"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",
24962497
"Local password policies": "Lokale Kennwortrichtlinien",
24972498
"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
@@ -2492,6 +2492,7 @@
24922492
"Live trigger": "Live trigger",
24932493
"Loading current message count...": "Loading current message count...",
24942494
"Local": "Local",
2495+
"Local authentication cannot be changed when authentication is managed by environment configuration": "Local authentication cannot be changed when authentication is managed by environment configuration",
24952496
"Local authentication cannot be disabled when no other authentication provider is enabled": "Local authentication cannot be disabled when no other authentication provider is enabled",
24962497
"Local password policies": "Local password policies",
24972498
"Local settings": "Local settings",

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4813,9 +4813,8 @@
48134813
"You need to validate your two-factor authentication. Please type the code generated in your application": "Debe validar su autenticación de dos factores. Por favor, escriba el código generado en su aplicación.",
48144814
"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)",
48154815
"You should activate EE to use this feature": "Debe activar EE para utilizar esta función",
4816-
"You should provide a variable name": "Debes proporcionar un nombre de variable",
4817-
"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.",
4818-
"You will be able to revert this change if needed. ": "Podrás revertir este cambio si es necesario.",
4816+
"You should provide a variable name": "Debe proporcionar un nombre de variable",
4817+
"You will be able to revert this change if needed. ": "Podrá revertir este cambio si es necesario.",
48194818
"You will be automatically logged out at end of the timer.": "Se cerrará la sesión automáticamente al final del temporizador.",
48204819
"You will find here the computed state.": "Aquí encontrará el estado calculado.",
48214820
"You will find here the result in JSON format.": "Aquí encontrará el resultado en formato JSON.",
@@ -4843,4 +4842,4 @@
48434842
"Zoom": "Zoom",
48444843
"Zoom in": "Ampliar",
48454844
"Zoom out": "Alejar"
4846-
}
4845+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,6 +2492,7 @@
24922492
"Live trigger": "Déclencheur live",
24932493
"Loading current message count...": "Chargement du nombre de messages en cours...",
24942494
"Local": "Local",
2495+
"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",
24952496
"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é",
24962497
"Local password policies": "Politiques locales en matière de mots de passe",
24972498
"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
@@ -2492,6 +2492,7 @@
24922492
"Live trigger": "Trigger live",
24932493
"Loading current message count...": "Caricamento del numero di messaggi attuali...",
24942494
"Local": "Locale",
2495+
"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",
24952496
"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",
24962497
"Local password policies": "Politiche locali sulla password",
24972498
"Local settings": "Impostazioni locali",

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

Lines changed: 33 additions & 3 deletions
Large diffs are not rendered by default.

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

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

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

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,6 +2492,7 @@
24922492
"Live trigger": "实时触发器",
24932493
"Loading current message count...": "正在加载当前信息数...",
24942494
"Local": "本地",
2495+
"Local authentication cannot be changed when authentication is managed by environment configuration": "当身份验证由环境配置管理时,无法更改本地身份验证",
24952496
"Local authentication cannot be disabled when no other authentication provider is enabled": "当未启用其他身份验证提供程序时,无法禁用本地身份验证",
24962497
"Local password policies": "本地密码策略",
24972498
"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)