[
https://issues.apache.org/jira/browse/KNOX-3296?focusedWorklogId=1014374&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1014374
]
ASF GitHub Bot logged work on KNOX-3296:
----------------------------------------
Author: ASF GitHub Bot
Created on: 09/Apr/26 20:26
Start Date: 09/Apr/26 20:26
Worklog Time Spent: 10m
Work Description: Raghav-Mah3shwari opened a new pull request, #1196:
URL: https://github.com/apache/knox/pull/1196
[KNOX-1234](https://issues.apache.org/jira/browse/KNOX-1234) - Add
integration tests for health API and KnoxLDAP preauth/extauthz paths
What changes were proposed in this pull request?
This pull request extends
[.github/workflows/tests](vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/.github/workflows/tests)
and the Docker Compose–based CI path so Knox is exercised with additional
automated integration coverage:
test_health.py: Asserts /gateway/health/v1/metrics returns JSON (with and
without pretty), checks top-level metric keys align with the Java health test
expectations, and verifies /gateway/health/v1/ping responds with text/plain in
addition to the existing ping and HSTS checks.
test_knoxauth_preauth_and_paths.py: Covers KnoxLDAP preauth (401 without or
with bad credentials; 200 for POST/GET with valid credentials;
x-knox-actor-username and group headers for admin) and verifies extauthz does
not swallow unknown path segments (404 for a non-existent subpath).
How was this patch tested?
Built the workflow Knox image and ran the compose stack, then executed the
integration test container (same flow as .github/workflows/tests/README.md).
Command (from the repo root, paths as in the README):
docker compose -f ./.github/workflows/compose/docker-compose.yml up --build
--exit-code-from tests tests
Confirmed pytest collects and passes the new cases together with existing
workflow tests (health ping, LDAP auth service, configs, remote auth, etc.).
Integration Tests
Yes. New/updated tests live under .github/workflows/tests:
Issue Time Tracking
-------------------
Worklog Id: (was: 1014374)
Remaining Estimate: 0h
Time Spent: 10m
> Expand CI integration tests: health metrics, HSTS, and KnoxLDAP auth paths
> --------------------------------------------------------------------------
>
> Key: KNOX-3296
> URL: https://issues.apache.org/jira/browse/KNOX-3296
> Project: Apache Knox
> Issue Type: Improvement
> Components: KnoxCLI
> Reporter: Raghav Maheshwari
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> * Health API tests ({{{}test_health.py{}}})
> ** {{/gateway/health/v1/metrics}}: JSON response, alignment with Java
> {{GatewayHealthFuncTest}} top-level keys (timers, histograms, counters,
> gauges, version, meters), with and without {{{}pretty=true{}}}.
> ** {{/gateway/health/v1/ping}}: {{Content-Type}} is plain text; existing
> ping + HSTS checks retained.
> * KnoxLDAP auth tests ({{{}test_knoxauth_preauth_and_paths.py{}}})
> ** Preauth ({{{}/gateway/knoxldap/auth/api/v1/pre{}}}): unauthenticated →
> 401; bad credentials → 401; POST and GET with valid guest credentials → 200
> and {{{}x-knox-actor-username{}}}; admin → 200 and expected group headers
> ({{{}longGroupName1{}}}, {{{}longGroupName2{}}}).
> ** Extauthz path behavior: GET under {{extauthz}} with an extra path segment
> returns 404 (path not ignored), guarding routing/regression for KnoxLDAP.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)