summaryrefslogtreecommitdiffstats
path: root/tests/run-tests.sh
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2019-06-21 13:03:04 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2019-06-24 13:42:25 +0200
commitfd305405b753528dd53934a15c5194feb6deb7a9 (patch)
treedf2f72a0bd85a8c2f9da0c6056983087766c6198 /tests/run-tests.sh
parente45455ec8206d676ff3513dc56456a7e27bc402b (diff)
#915 add support for HTTP Authorization
Add APITOKEN= field to ogAdmServer.cfg to specify the REST API key.
Diffstat (limited to 'tests/run-tests.sh')
-rwxr-xr-xtests/run-tests.sh22
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/run-tests.sh b/tests/run-tests.sh
index f0cae2a..ca00b5f 100755
--- a/tests/run-tests.sh
+++ b/tests/run-tests.sh
@@ -1,10 +1,12 @@
-curl -X POST http://127.0.0.1:8888/clients -d @post_clients.json
-curl -X GET http://127.0.0.1:8888/clients
-curl -X POST http://127.0.0.1:8888/wol -d @wol.json
-curl -X POST http://127.0.0.1:8888/shell/run -d @post_shell_run.json
-curl -X POST http://127.0.0.1:8888/shell/output -d @post_shell_output.json
-curl -X POST http://127.0.0.1:8888/session -d @session.json
-curl -X POST http://127.0.0.1:8888/poweroff -d @poweroff.json
-curl -X POST http://127.0.0.1:8888/reboot -d @reboot.json
-curl -X POST http://127.0.0.1:8888/stop -d @stop.json
-curl -X POST http://127.0.0.1:8888/refresh -d @refresh.json
+API_KEY="07b3bfe728954619b58f0107ad73acc1"
+
+curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/clients -d @post_clients.json
+curl -X GET -H "Authorization: $API_KEY" http://127.0.0.1:8888/clients
+curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/wol -d @wol.json
+curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/shell/run -d @post_shell_run.json
+curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/shell/output -d @post_shell_output.json
+curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/session -d @session.json
+curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/poweroff -d @poweroff.json
+curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/reboot -d @reboot.json
+curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/stop -d @stop.json
+curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/refresh -d @refresh.json