-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-auth.sh
More file actions
executable file
·28 lines (21 loc) · 1.04 KB
/
test-auth.sh
File metadata and controls
executable file
·28 lines (21 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
echo "Testing Proton Authentication"
echo "=============================="
# Test 1: Default user (no auth)
echo "1. Default user (no auth):"
curl -s "http://localhost:8125/?query=SELECT%20current_user()" && echo
# Test 2: Using X-ClickHouse headers
echo "2. proton_user with X-ClickHouse headers:"
curl -s "http://localhost:8125/?query=SELECT%20current_user()" \
-H "X-ClickHouse-User: proton_user" \
-H "X-ClickHouse-Key: proton_ocaml_test" && echo
# Test 3: Using query parameters
echo "3. proton_user with query parameters:"
curl -s "http://localhost:8125/?query=SELECT%20current_user()&user=proton_user&password=proton_ocaml_test" && echo
# Test 4: Using basic auth
echo "4. proton_user with basic auth:"
curl -s --user "proton_user:proton_ocaml_test" "http://localhost:8125/?query=SELECT%20current_user()" && echo
# Test 5: Native client
echo "5. proton_user with native client:"
/opt/homebrew/bin/proton client --host localhost --port 8465 --user proton_user --password proton_ocaml_test --query "SELECT current_user()"
echo "Done!"