Files
qdrant-helm/test/integration/api_key.bats
SamirPS 4ead93adbe Release 0.8.5 with Qdrant 1.9.0 (#169)
Co-authored-by: Bastian Hofmann <mail@bastianhofmann.de>
2024-04-25 10:48:43 -06:00

21 lines
973 B
Bash

setup_file() {
helm upgrade --install qdrant charts/qdrant --set apiKey=foobar -n qdrant-helm-integration --wait
kubectl rollout status statefulset qdrant -n qdrant-helm-integration
}
@test "api key authentication works" {
run kubectl exec -n default curl -- curl -s http://qdrant.qdrant-helm-integration:6333/collections -H 'api-key: foobar' --fail-with-body
[ $status -eq 0 ]
[[ "${output}" =~ .*\"status\":\"ok\".* ]]
}
@test "api key authentication fails with no key" {
run kubectl exec -n default curl -- curl -s -w " - %{response_code}" http://qdrant.qdrant-helm-integration:6333/collections
[ "${output}" = "Must provide an API key or an Authorization bearer token - 401" ]
}
@test "api key authentication fails with wrong key" {
run kubectl exec -n default curl -- curl -s -w " - %{response_code}" http://qdrant.qdrant-helm-integration:6333/collections -H 'api-key: invalid'
[ "${output}" = "Invalid API key or JWT - 401" ]
}