Skip to content

Commit 71de9e2

Browse files
committed
Added unauthorized test for model registry
Signed-off-by: kunal-511 <[email protected]>
1 parent c27ef68 commit 71de9e2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/full_kubeflow_integration_test.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
run: ./tests/gh-actions/install_training_operator.sh
8181

8282
- name: Install Knative
83-
run: ./tests/gh-actions/install_knative.sh
83+
run: ./tests/gh-actions/install_knative-cni.sh
8484

8585
- name: Install KServe
8686
run: ./tests/gh-actions/install_kserve.sh
@@ -197,6 +197,20 @@ jobs:
197197
"localhost:8080/model-registry/api/v1/model_registry?namespace=${KF_PROFILE}" \
198198
-H "Authorization: Bearer ${KF_TOKEN}"
199199
200+
- name: Test Model Registry API with Unauthorized Token
201+
run: |
202+
UNAUTHORIZED_TOKEN=$(kubectl -n test-unauthorized create token test-unauthorized || kubectl -n test-unauthorized create token default)
203+
204+
STATUS_CODE=$(curl -s \
205+
--output /dev/stderr --write-out "%{http_code}" \
206+
"localhost:8080/model-registry/api/v1/model_registry?namespace=${KF_PROFILE}" \
207+
-H "Authorization: Bearer ${UNAUTHORIZED_TOKEN}")
208+
209+
if test $STATUS_CODE -ne 403; then
210+
echo "Error: Unauthorized access was not correctly rejected. Got status code: ${STATUS_CODE}"
211+
exit 1
212+
fi
213+
200214
- name: Apply Pod Security Standards Baseline
201215
run: ./tests/gh-actions/enable_baseline_PSS.sh
202216

0 commit comments

Comments
 (0)