forked from IQSS/dataverse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestBlockEndpoints.sh
More file actions
executable file
·53 lines (39 loc) · 1.31 KB
/
Copy pathtestBlockEndpoints.sh
File metadata and controls
executable file
·53 lines (39 loc) · 1.31 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
ADMIN_KEY=$1
echo Testing Groups
curl http://localhost:8080/api/admin/groups/ip/?key=$ADMIN_KEY
echo
echo blocking groups
curl -X PUT -d groups http://localhost:8080/api/admin/settings/:BlockedApiEndpoints
echo
echo Testing Groups again - expecting 503 Unavailable
curl -v http://localhost:8080/api/admin/groups/ip/?key=$ADMIN_KEY
echo
echo Unblocking groups
curl -X DELETE http://localhost:8080/api/admin/settings/:BlockedApiEndpoints
echo
echo Testing Groups
curl http://localhost:8080/api/admin/groups/ip/?key=$ADMIN_KEY
echo
echo blocking groups, Roles
curl -X PUT -d groups,roles http://localhost:8080/api/admin/settings/:BlockedApiEndpoints
echo
echo Testing Groups again - expecting 503 Unavailable
curl -v http://localhost:8080/api/admin/groups/ip/?key=$ADMIN_KEY
echo
echo Testing Roles - expecting 503 Unavailable
curl -v http://localhost:8080/api/roles/?key=$ADMIN_KEY
echo
echo blocking Roles only
curl -X PUT -d roles http://localhost:8080/api/admin/settings/:BlockedApiEndpoints
echo
echo Testing Groups again
curl -v http://localhost:8080/api/admin/groups/ip/?key=$ADMIN_KEY
echo
echo Testing Roles - expecting 503 Unavailable
curl -v http://localhost:8080/api/roles/?key=$ADMIN_KEY
echo
echo Unblocking all
curl -X DELETE http://localhost:8080/api/admin/settings/:BlockedApiEndpoints
echo
echo DONE