summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnst Widerberg <ernstwi@kth.se>2021-09-24 09:02:21 +0200
committerErnst Widerberg <ernstwi@kth.se>2021-09-24 09:02:21 +0200
commitefa0c7c992bda7930ba7b40abfd6f3e4718db4d5 (patch)
tree8cde56bf2dcb3f087031b53481d701b58879d9ff
parent0398e77a809abcaf78c6f7d3e6064a5bee50be23 (diff)
Update README
-rw-r--r--README.md14
1 files changed, 8 insertions, 6 deletions
diff --git a/README.md b/README.md
index c391971..6bb4d49 100644
--- a/README.md
+++ b/README.md
@@ -63,13 +63,15 @@ Start CouchDB, make sure to give it a username and password:
Start the demo HTTP server. Here we should pass on a few environment
variables to let it know which CouchDB to use:
+ cd demo
export DB_NAME=test
export DB_HOSTNAME=localhost
export DB_USERNAME=couchdb
export DB_PASSWORD=insecure
- python3 src/wsgi.py
+ python3 ../src/wsgi.py
-Submit some data.
+Try adding some observations, basic auth user:pw from `wsgi_demo_users.yaml`,
+including `{"domain": "sunet.se"}` in at least one of them:
echo '[{
"ip": "192.0.2.10",
@@ -90,12 +92,12 @@ Submit some data.
"cve_2021_21974": "CVE-2021-21974 patched",
"cve_2021_21985": "CVE-2021-21985 not applicable"
}
- }]' | curl -s -u admin:admin --data-binary @- http://localhost:8000/sc/v0/add
+ }]' | curl -s -u user3:pw3 --data-binary @- http://localhost:8000/sc/v0/add
-Get the same data back.
+Try retreiving all observations for a user with read access to 'sunet.se':
- curl -s -u sunet.se: http://localhost:8000/sc/v0/get | json_pp -json_opt utf8,pretty
+ curl -s -u user1:pw1 http://localhost:8000/sc/v0/get | json_pp -json_opt utf8,pretty
We might also filter the data:
- curl -s -u sunet.se: http://localhost:8000/sc/v0/get?port=111 | json_pp -json_opt utf8,pretty
+ curl -s -u user1:pw1 http://localhost:8000/sc/v0/get?port=111 | json_pp -json_opt utf8,pretty