Skip to content

A peer-to-peer stack for code collaboration

feat: Allow unsigned request (#629)

Merle Breitkreuz9c6133d102c5
diff --git a/rad/monadic/issue-remote.rad b/rad/monadic/issue-remote.rad
index e6aa604..321b168 100644
--- a/rad/monadic/issue-remote.rad
+++ b/rad/monadic/issue-remote.rad
@@ -183,10 +183,8 @@
x
(insert :modified-at (lookup :created-at x) x))))
-(def create-issue
- "Create an issue from a dict, checking that it is valid and storing it in `issues`."
+(def add-issue
(fn [i]
- (validator/input i)
(def fixed
(insert :comments
(map fix-modified-at (lookup :comments i))
@@ -202,6 +200,18 @@
(noncer [:use (lookup :nonce i)])
n))
+(def create-issue
+ "Create an issue from a dict, checking that it is valid and storing it in `issues`."
+ (fn [i]
+ (validator/input i)
+ (add-issue i)))
+
+(def anonymous-create-issue
+ "Anonymously create an issue from a dict, checking that it is valid and storing it in `issues`."
+ (fn [i]
+ ((validator/keys input-keys) i)
+ (add-issue i)))
+
(def add-comment
"Add a comment to an issue."
(fn [c]
@@ -244,12 +254,13 @@
(def commands
"The set of allowed machine commands."
- {'create-issue create-issue
- 'edit-issue edit-issue
- 'add-comment add-comment
- 'edit-comment edit-comment
- 'list-issues list-issues
- 'add-admin (add-admin auth)})
+ {'create-issue create-issue
+ 'anonymous-create-issue anonymous-create-issue
+ 'edit-issue edit-issue
+ 'add-comment add-comment
+ 'edit-comment edit-comment
+ 'list-issues list-issues
+ 'add-admin (add-admin auth)})
(def eval (make-updatable-eval commands (auth [:allowed :admin])))