You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8d3aefe
Browse filesBrowse the repository at this point in the historyBrowse files
chore(auth): address PR review feedback from CodeRabbit and jokob-sk
- Reverted unrelated changes to docker-compose.yml, .env, and server/__main__.py to prevent scope creep.
- Added regex sanitization to X-Forwarded-For IP parsing and LDAP identifiers to prevent log injection.
- Validated API_TOKEN before authenticating sessions in front/index.php.
- Delegated hardcoded local admin fallback to LocalProvider.is_fallback_allowed().
- Made FAILED_LOGINS thresholds configurable via UI settings.
- Increased Docker UI test reliability by replacing sleeps with ldapwhoami polling and dynamic container resolution.
- Moved test_ldap.py to test/plugins/test_ldap_ui_config.py for centralized testing structure.
Copy file name to clipboardExpand all lines: .github/workflows/run-all-tests.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,7 @@ jobs:
66
66
if [ "${{ github.event.inputs.run_api }}" == "true" ]; then PATHS="$PATHS test/api_endpoints/ test/server/"; fi
67
67
if [ "${{ github.event.inputs.run_backend }}" == "true" ]; then PATHS="$PATHS test/backend/ test/db/"; fi
68
68
if [ "${{ github.event.inputs.run_docker_env }}" == "true" ]; then PATHS="$PATHS test/docker_tests/"; fi
69
+
if [ "${{ github.event.inputs.run_ldap }}" == "true" ]; then PATHS="$PATHS test/server/test_ldap_provider.py test/server/test_ldap_provider_env.py test/ui/test_ui_ldap_login.py test/docker_tests/test_ldap_ui.py"; fi
69
70
if [ "${{ github.event.inputs.run_ui }}" == "true" ]; then PATHS="$PATHS test/ui/"; fi
70
71
if [ "${{ github.event.inputs.run_plugins }}" == "true" ]; then PATHS="$PATHS test/plugins/"; fi
1.`docker-compose.yml` and `.env`: Reverted to `origin/main` to remove unrelated changes and avoid warning about missing variables or obsolete Compose version syntax.
5
+
2.`server/__main__.py`: Reverted `is_idle_this_loop` logic and idle notification to match `origin/main`.
6
+
3.`server/plugin.py`: Verified that it matches `origin/main` (no unrelated `sample_json` or `_run_test_cmd` changes exist).
7
+
8
+
9
+
## api_server_start.py Issues
10
+
1. Re-added `localhost` to the CORS and trusted_proxies list to avoid breaking integrations like homepage dashboards.
11
+
2. Made rate-limiting constants (`FAILED_LOGINS` and `MAX_FAILED_ATTEMPTS`) dynamic via `AUTH_MAX_FAILED_ATTEMPTS` and `AUTH_LOCKOUT_TIME`.
12
+
3. Added strict sanitization of `client_ip` from `X-Forwarded-For` using regex to mitigate log injection vectors.
13
+
14
+
## Flaky UI Tests
15
+
1. Replaced `time.sleep(2)` with a `WebDriverWait` in `test/ui/test_ui_ldap_login.py` as requested by CodeRabbit.
16
+
17
+
## Docker Test Reliability
18
+
1. Replaced hardcoded container names in `test/docker_tests/test_ldap_ui.py` with dynamic resolution using `docker ps` filters to support Compose V2 correctly.
19
+
2. Removed hardcoded 10-second sleeps and added a bounded polling loop checking LDAP readiness via `ldapwhoami`.
20
+
3. Added strict timeouts to `subprocess.run` commands during Docker test setup to prevent CI hangs.
21
+
22
+
## Auth Logic Safety
23
+
1. Moved `$_SESSION['login'] = 1` assignment in `front/index.php` to *after* the `API_TOKEN` is successfully resolved to prevent partially authenticated sessions without tokens.
24
+
25
+
## LDAP Provider Fixes
26
+
1. Updated PHP frontend `LDAP_enabled` check in `security.php` to accept `yes` and `on` in addition to `true` and `1`, matching the backend behavior.
27
+
2. Fixed `server/auth/ldap_provider.py` to strictly check the boolean return of `conn.search()` and fail properly if the LDAP search operation fails, as pointed out by CodeRabbit.
28
+
29
+
## Code Organization
30
+
1. Moved `test_ldap.py` out of the frontend plugins directory into `test/plugins/test_ldap_ui_config.py` and updated the plugin's `config.json` to reference the new path.
Copy file name to clipboardExpand all lines: front/plugins/auth_ldap/config.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -202,7 +202,7 @@
202
202
"description": [
203
203
{
204
204
"language_code": "en_us",
205
-
"string": "Upgrade a plain-text LDAP connection to TLS using the STARTTLS command. Typically used with port 389. Mutually exclusive with LDAPS."
205
+
"string": "Upgrade a plain-text LDAP connection to TLS using the STARTTLS command. Typically used with port 389. Mutually exclusive with LDAPS.<br><br><b>Recommended: set to true (or use LDAP_USE_SSL=true with port 636) before production.</b>"
0 commit comments