-
Notifications
You must be signed in to change notification settings - Fork 66
Conversation
Add <uri-param name="language">sjs</uri-param> to your request definition to make use of a SJS controller. Issue marklogic-community#640.
…they are required for Roxy's rewriter
Updated previous changes based on dcassel's suggestions. Tested using the sample SJS requests and test.sjs in marklogic-community#640.
marklogic-community#640: Support SJS with a language property
marklogic-community#640 updating unit tests for SJS controllers
Granting any-uri could definitely circumvent security at larger orgs and gov. Preferably could we just define the proper URI permissions? That being said, I'm also totally cool with merging this and then defining this task in a separate issue for a later milestone. Beyond that, it looks good to me! |
Conflicts: src/test/suites/Framework Tests/routing.xqy src/test/suites/Framework Tests/site-index.xqy
The amps approach doesn't work, because we support using the filesystem for modules. Amps may not be applied to filesystem code unless it's under the MarkLogic install directory. New approach: the testing role gets the general app role, plus several privileges needed for running tests.
They don't work because they rely on property substitution in test-config.xqy to indicate what user the requests should be made as.
@@ -458,6 +458,12 @@ | |||
</collections> | |||
<privileges> | |||
<privilege> | |||
<privilege-name>any-uri</privilege-name> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this any-uri assignment belong in the (optional) ${app-role}-unit-test ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. Yes, it does. I'll move that and run another comparison between the ml-config.xml I tested with and this file.
@RobertSzkutak I moved the any-uri privilege. |
That looks good! It worked fine last night when I tested it too. Merging.. |
This PR makes unit tests work out of the box with the default user (ie, no longer requiring admin for tests to work).
Question for reviewers: any concerns with the privileges that I've granted to the default user?
Three of those are required for Roxy's rewriter to work (see src/roxy/rewriter-lib.xqy rewrite-rules();
eput:get-rest-options
requires rest-reader).The amps should be safe, in that the code they refer to isn't even deployed in production.