Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Issue 563 #674

Merged
merged 12 commits into from
Oct 26, 2016
Merged

Issue 563 #674

merged 12 commits into from
Oct 26, 2016

Conversation

dmcassel
Copy link
Collaborator

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?

  • any-uri
  • rest-reader
  • xdmp:get-server-field
  • xdmp:set-server-field

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.

Preston McGowan and others added 3 commits October 18, 2016 21:56
Add <uri-param name="language">sjs</uri-param> to your request
definition to make use of a SJS controller.
Issue marklogic-community#640.
Preston McGowan and others added 4 commits October 19, 2016 20:39
Updated previous changes based on dcassel's suggestions.
Tested using the sample SJS requests and test.sjs in marklogic-community#640.
@RobertSzkutak
Copy link
Contributor

RobertSzkutak commented Oct 23, 2016

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>
Copy link
Contributor

@RobertSzkutak RobertSzkutak Oct 26, 2016

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 ?

Copy link
Collaborator Author

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.

@dmcassel
Copy link
Collaborator Author

@RobertSzkutak I moved the any-uri privilege.

@RobertSzkutak
Copy link
Contributor

That looks good! It worked fine last night when I tested it too. Merging..

@RobertSzkutak RobertSzkutak merged commit 305d9c5 into marklogic-community:dev Oct 26, 2016
@dmcassel dmcassel deleted the issue-563 branch October 26, 2016 14:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants