summaryrefslogtreecommitdiff
path: root/yarns/900-implements.yarn
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-11-16 21:36:04 +0200
committerLars Wirzenius <liw@liw.fi>2018-11-16 21:36:04 +0200
commit6d621d3a51ba68f0a436d5c5b27ace6cb2825f50 (patch)
tree6817d537d5475ccd3b8d888e20cdc51bd357f33e /yarns/900-implements.yarn
parentd30c7d5dac5891ad86a3491e198cb384e466932e (diff)
downloadmuck-poc-6d621d3a51ba68f0a436d5c5b27ace6cb2825f50.tar.gz
Change: allow super users to impersonate other users
Diffstat (limited to 'yarns/900-implements.yarn')
-rw-r--r--yarns/900-implements.yarn15
1 files changed, 15 insertions, 0 deletions
diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn
index c81d1ef..22d6463 100644
--- a/yarns/900-implements.yarn
+++ b/yarns/900-implements.yarn
@@ -12,6 +12,14 @@
IMPLEMENTS FINALLY Muck is stopped
stop_muck()
+## Create users
+
+
+ IMPLEMENTS GIVEN a user (\S+) with superuser access
+ user = get_next_match()
+ users = V['superusers'] or []
+ V['superusers'] = users + [user]
+
## HTTP requests
IMPLEMENTS WHEN user (\S+) makes request POST /res with body (.*)
@@ -19,6 +27,13 @@
body = get_expanded_match()
POST(user, '/res', {}, json.loads(body))
+ IMPLEMENTS WHEN user (\S+) makes request POST /res with header "(\S+): (.+)" and body (.*)
+ user = get_expanded_match()
+ header = get_expanded_match()
+ value = get_expanded_match()
+ body = get_expanded_match()
+ POST(user, '/res', {header:value}, json.loads(body))
+
IMPLEMENTS WHEN user (\S+) makes request GET /res with header "(\S+): (.+)"
user = get_expanded_match()
header = get_expanded_match()