From c71e605abd415cf576cf1f7443c13a15379ad2c8 Mon Sep 17 00:00:00 2001 From: Pascal Date: Sun, 7 Mar 2021 19:45:01 -0500 Subject: [PATCH] [mod] modified readme to include query string support - considered experimental until more test coverage is done --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a3df575..a34d4f9 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,11 @@ JSON_REQUEST_BODY='{ "public_ip": false }' http post $API_SERVER/admin/client $API_KEY <<< $JSON_REQUEST_BODY + +# Alternatively using query strings (be sure to encode special characters in the param values) +API_KEY='X-API-Key=MdSUxrQQ.d5d40cd9.e2s1BsQEqmSE5MqyHYbDBVxGr/KY4BYIV5QkdjiCOF0=' +CLIENT_PARAMS='name=clientA&description=Client+across+the+river&permission=rw&public_ip=false' +http post "$API_SERVER/admin/client?$API_KEY&$CLIENT_PARAMS" ``` Updating a write client's `ipv4`: ```bash @@ -67,7 +72,7 @@ API_SERVER=http://localhost:3000/rynDNS API_KEY=X-API-Key:zW3If4s5.28aef5cb.d502cb94ba0802c6363f95ecb3a70de7e2e4b889779e435b7c033f2c72ed4f20 CLIENT_NAME=write_client -http get $API_SERVER/clients/$CLIENT_NAME $ API_KEY +http get $API_SERVER/clients/$CLIENT_NAME $API_KEY # returns clients name and ipv4 as json #{ @@ -80,6 +85,8 @@ A detailed and interactive specification can be found in the [demo](https://demo All requests except for `/public/*` require a valid `X-API-Key` header with appropriate permission. +**Experimental:** All parameters (including `X-API-Key`) can be passed as query string. + The following is a quick overview of the available commands. ### Admin @@ -131,5 +138,7 @@ RAILS_DEMO_RESET: 60m ## Roadmap * `Public Mode` - to allow for quick deployment without having to create clients/api-keys in a trusted environment (see #1) -* Support Query Strings - as alternative to api key in header and json body +* ~~Support Query Strings - as alternative to api key in header and json body~~ (merged 297016e799) + * add full test coverage for query strings (considered experimental until then) + * add query strings to `api.yml` and additional examples * DNS Server in Docker container - resolve `client_name`s via DNS server