diff --git a/content/posts/2018-09.md b/content/posts/2018-09.md index 6622fd3af..95aece8dd 100644 --- a/content/posts/2018-09.md +++ b/content/posts/2018-09.md @@ -66,4 +66,51 @@ Caused by: java.lang.RuntimeException: Failed to startup the DSpace Service Mana - One invalid value for `dc.type` - Abenet says she hasn't received any more subscription emails from the CUA module since she unsubscribed yesterday, so I think we don't need create an issue on Atmire's bug tracker anymore +## 2018-09-10 + +- Playing with [strest](https://github.com/eykhagen/strest) to test the DSpace REST API programatically +- For example, given this `test.yaml`: + +``` +version: 1 + +requests: + test: + method: GET + url: https://dspacetest.cgiar.org/rest/test + validate: + raw: "REST api is running." + + login: + url: https://dspacetest.cgiar.org/rest/login + method: POST + data: + json: {"email":"test@dspace","password":"thepass"} + + status: + url: https://dspacetest.cgiar.org/rest/status + method: GET + headers: + rest-dspace-token: Value(login) + + logout: + url: https://dspacetest.cgiar.org/rest/logout + method: POST + headers: + rest-dspace-token: Value(login) + +# vim: set sw=2 ts=2: +``` + +- Works pretty well, though the DSpace `logout` always returns an HTTP 415 error for some reason +- We could eventually use this to test sanity of the API for creating collections etc +- A user is getting an error in her workflow: + +``` +2018-09-10 07:26:35,551 ERROR org.dspace.submit.step.CompleteStep @ Caught exception in submission step: +org.dspace.authorize.AuthorizeException: Authorization denied for action WORKFLOW_STEP_1 on COLLECTION:2 by user 3819 +``` + +- Seems to be during submit step, because it's workflow step 1...? + diff --git a/docs/2018-09/index.html b/docs/2018-09/index.html index 42fb79c29..e590d7cbd 100644 --- a/docs/2018-09/index.html +++ b/docs/2018-09/index.html @@ -18,7 +18,7 @@ I’m testing the new DSpace 5.8 branch in my Ubuntu 18.04 environment and I " /> - + Abenet says she hasn’t received any more subscription emails from the CUA module since she unsubscribed yesterday, so I think we don’t need create an issue on Atmire’s bug tracker anymore +
test.yaml
:version: 1
+
+requests:
+ test:
+ method: GET
+ url: https://dspacetest.cgiar.org/rest/test
+ validate:
+ raw: "REST api is running."
+
+ login:
+ url: https://dspacetest.cgiar.org/rest/login
+ method: POST
+ data:
+ json: {"email":"test@dspace","password":"thepass"}
+
+ status:
+ url: https://dspacetest.cgiar.org/rest/status
+ method: GET
+ headers:
+ rest-dspace-token: Value(login)
+
+ logout:
+ url: https://dspacetest.cgiar.org/rest/logout
+ method: POST
+ headers:
+ rest-dspace-token: Value(login)
+
+# vim: set sw=2 ts=2:
+
+
+logout
always returns an HTTP 415 error for some reason2018-09-10 07:26:35,551 ERROR org.dspace.submit.step.CompleteStep @ Caught exception in submission step:
+org.dspace.authorize.AuthorizeException: Authorization denied for action WORKFLOW_STEP_1 on COLLECTION:2 by user 3819
+
+
+