[
https://issues.apache.org/jira/browse/KNOX-3293?focusedWorklogId=1013956&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1013956
]
ASF GitHub Bot logged work on KNOX-3293:
----------------------------------------
Author: ASF GitHub Bot
Created on: 08/Apr/26 09:53
Start Date: 08/Apr/26 09:53
Worklog Time Spent: 10m
Work Description: Raghav-Mah3shwari commented on code in PR #1194:
URL: https://github.com/apache/knox/pull/1194#discussion_r3050547919
##########
.github/workflows/tests/test_knoxauth_preauth_and_paths.py:
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import os
+import unittest
+
+import requests
+import urllib3
+from requests.auth import HTTPBasicAuth
+
+# Suppress InsecureRequestWarning since we use verify=False for self-signed
certs
+urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
+
+
+def _base_url() -> str:
Review Comment:
yes sure, i m working on restructuring the test flows, i will raise that in
next pr
Issue Time Tracking
-------------------
Worklog Id: (was: 1013956)
Remaining Estimate: 23h 20m (was: 23.5h)
Time Spent: 40m (was: 0.5h)
> Add integration tests: health metrics JSON, KnoxLDAP preauth/extauthz paths,
> RemoteAuth extauthz
> ------------------------------------------------------------------------------------------------
>
> Key: KNOX-3293
> URL: https://issues.apache.org/jira/browse/KNOX-3293
> Project: Apache Knox
> Issue Type: Improvement
> Components: KnoxShell
> Reporter: Raghav Maheshwari
> Priority: Major
> Original Estimate: 24h
> Time Spent: 40m
> Remaining Estimate: 23h 20m
>
> New/extended pytest coverage under {{.github/workflows/tests/}} for the
> Docker Compose–driven Knox stack (health, {{{}knoxldap{}}}, {{remoteauth}}
> topologies).
> {{test_health.py}}
> * {{test_health_metrics_returns_json}} — {{GET
> /gateway/health/v1/metrics?pretty=true}} returns 200, response is JSON
> ({{{}Content-Type{}}} and parseable body as an object).
> {{test_knoxauth_preauth_and_paths.py}} (KnoxLDAP)
> * {{test_preauth_requires_auth}} — preauth without credentials → 401.
> * {{test_preauth_bad_credentials_unauthorized}} — invalid Basic auth → 401.
> * {{test_preauth_post_supported}} — POST to preauth with valid credentials
> works.
> * {{test_extauthz_additional_path_not_ignored_in_knoxldap}} — extra path
> under extauthz is not treated as the base resource (404 vs success).
> {{test_remoteauth_extauthz_additional_path.py}} (RemoteAuth)
> * {{test_extauthz_success}} — valid Basic auth → 200 and expected
> {{{}X-Knox-Actor-ID{}}}.
> * {{test_extauthz_additional_path_is_ignored}} — with
> ignore-additional-path, extra segments still succeed.
> * {{test_extauthz_bad_credentials_unauthorized}} — bad credentials → 401.
> * {{test_extauthz_missing_credentials_server_error}} — no {{Authorization}}
> header → 500 (current behavior).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)