Skip to content

Commit 7c1653f

Browse files
authored
Add bearer token to auth policy (#16)
Signed-off-by: Brent Salisbury <bsalisbu@redhat.com>
1 parent 720df67 commit 7c1653f

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

deployment/kuadrant-openshift/06-auth-policies-apikey.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
name: inference-gateway
1515
rules:
1616
authentication:
17-
api-key-users:
17+
api-key-users-apikey:
1818
apiKey:
1919
allNamespaces: true
2020
selector:
@@ -23,6 +23,15 @@ spec:
2323
credentials:
2424
authorizationHeader:
2525
prefix: APIKEY
26+
api-key-users-bearer:
27+
apiKey:
28+
allNamespaces: true
29+
selector:
30+
matchLabels:
31+
app: llm-gateway
32+
credentials:
33+
authorizationHeader:
34+
prefix: Bearer
2635
response:
2736
success:
2837
filters:

deployment/kuadrant-openshift/scripts/test-token-request-limits.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ set -euo pipefail
1111
API_HOST="simulator-llm.apps.summit-gpu.octo-emerging.redhataicoe.com"
1212
MODEL_ID="simulator-model"
1313
INFINITE=false
14+
NO_SLEEP=false
1415

1516
usage() {
1617
cat <<EOF
17-
Usage: $(basename "$0") [--host <hostname>] [-m|--model <model-id>] [-i|--infinite] [--help]
18+
Usage: $(basename "$0") [--host <hostname>] [-m|--model <model-id>] [-i|--infinite] [--no-sleep] [--help]
1819
1920
Options
2021
-H, --host <hostname> API host (default: $API_HOST)
2122
-m, --model <id> Override model ID (default: $MODEL_ID)
2223
-i, --infinite Run tests in a loop until interrupted (max ~10 min)
24+
-n, --no-sleep Skip sleep between iterations (infinite mode only)
2325
-h, --help Show this help and exit
2426
EOF
2527
}
@@ -30,6 +32,7 @@ while [[ $# -gt 0 ]]; do
3032
-H|--host) API_HOST="$2"; shift 2 ;;
3133
-m|--model) MODEL_ID="$2"; shift 2 ;;
3234
-i|--infinite) INFINITE=true; shift ;;
35+
-n|--no-sleep) NO_SLEEP=true; shift ;;
3336
-h|--help) usage; exit 0 ;;
3437
*) echo "❌ Unknown option: $1"; usage; exit 1 ;;
3538
esac
@@ -40,6 +43,7 @@ BASE_URL="http://${API_HOST}/v1/chat/completions"
4043
echo "📡 Host : $API_HOST"
4144
echo "🤖 Model ID: $MODEL_ID"
4245
echo "🔁 Infinite mode: $INFINITE"
46+
echo "😴 No sleep: $NO_SLEEP"
4347
echo
4448

4549
########################
@@ -97,8 +101,10 @@ if [ "$INFINITE" = true ]; then
97101
echo "🛑 Reached ~10 minutes, stopping."
98102
break
99103
fi
100-
echo "⏳ Sleeping 5s before next iteration..."
101-
sleep 5
104+
if [ "$NO_SLEEP" = false ]; then
105+
echo "⏳ Sleeping 5s before next iteration..."
106+
sleep 5
107+
fi
102108
done
103109
else
104110
run_tests

0 commit comments

Comments
 (0)