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

Configuring Roxy for Unit Testing in ML8 #563

Closed
jeet1212 opened this issue Jan 2, 2016 · 5 comments
Closed

Configuring Roxy for Unit Testing in ML8 #563

jeet1212 opened this issue Jan 2, 2016 · 5 comments
Assignees
Milestone

Comments

@jeet1212
Copy link

jeet1212 commented Jan 2, 2016

Hi,

I was testing Unit Tests feature of the Roxy for my project however no success.I am using roxy as MVC not hybrid. I am testing it in ML8.

When I invoked url http://localhost:8042/test, started seeing below error.
error in /roxy/rewrite.xqy line number 40, conf:rewrite() function not found.

else
try
{
xdmp:eval('
import module namespace conf = "http://marklogic.com/rest-api/endpoints/config"
at "/MarkLogic/rest-api/endpoints/config.xqy";
declare variable $method external;
declare variable $uri external;
declare variable $path external;
(conf:rewrite($method, $uri, $path), $uri)[1]',
(xs:QName("method"), $method,
xs:QName("uri"), $uri,
xs:QName("path"), $path))
}
catch($ex) {
if ($ex/error:code = "XDMP-MODNOTFOUND") then
$uri
else
xdmp:rethrow()
}

Also some of the default UTs are not running due to URI security privileges.

Please let me know if I am missing for providing appropriate privileges to the default user.

Regards,
Indy

@RobertSzkutak
Copy link
Contributor

rewrite.xqy is broken in Roxy in MarkLogic 8.0-2 and up. Depending on which version you're running, there are some workarounds in this thread: #416

@jeet1212
Copy link
Author

jeet1212 commented Jan 3, 2016

Thank you for sharing it however it seems there are security privileges for
default user as well.

I noticed that the default user should have xdmp:eval, eval-in and uri
privileges.

Please suggest if I am missing something.

Regards,
Indy
On 03-Jan-2016 7:24 pm, "Robert Szkutak" notifications@github.com wrote:

It's a known issue that rewrite.xqy is broken in Roxy in MarkLogic 8.0-2
and up. Depending on which version you're running, there are some
workarounds in this thread: #416
#416


Reply to this email directly or view it on GitHub
#563 (comment).

@dmcassel
Copy link
Collaborator

There are several missing privileges that prevent the app-user from being able to run the built-in unit tests. I'm exploring the best way to fix that.

dmcassel added a commit to dmcassel/roxy that referenced this issue Oct 19, 2016
@dmcassel
Copy link
Collaborator

Took me a while to get to this, but I just submitted a PR. Reviews welcome.

@dmcassel dmcassel added this to the 1.7.4 milestone Oct 19, 2016
dmcassel added a commit to dmcassel/roxy that referenced this issue Oct 25, 2016
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.
dmcassel added a commit to dmcassel/roxy that referenced this issue Oct 25, 2016
They don't work because they rely on property substitution in
test-config.xqy to indicate what user the requests should be made as.
dmcassel added a commit to dmcassel/roxy that referenced this issue Oct 25, 2016
@dmcassel
Copy link
Collaborator

fixed in dev

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants