The simplest way is to use 2 ports, the 'stock' REST port for rest, and an HTTP 
port for your app.  This allows for the greatest flexibility wrt security, and 
is generally easier to configure.
Sometimes it’s a win wrt networking (don’t expose the port of the REST api app, 
just expose your port).   Sometimes it’s an added difficulty.

To customize the rewriter, I recommend generating a 'new' REST app (vs using 
port 8000).  That has the least complicated rewriter (XML Rewriter) for mixing 
custom code.
You will need to figure out what you mean exactly by preventing end users from 
accessing the REST API -- there must be something that is unique in your app's 
headers or request to distinguish 'your app' and 'users'  -- such as 
authentication, IP address.
The rewriter wasn’t designed as a firewall - its easy to add your own app and 
redirect to it, or to remove standard dispatching -- but to keep the REST API 
working only for some users not others is more difficult.    If you don’t care 
if the API is 'available' but simply not authorized then use different users & 
roles for authentication.
To fully 'hide' the REST API's is easier done by networking (firewalls, 
iptables etc.).




From: [email protected] 
[mailto:[email protected]] On Behalf Of Rajesh Kumar
Sent: Tuesday, April 18, 2017 2:09 PM
To: [email protected]
Subject: [MarkLogic Dev General] custom Rest rewriter

Hi Team,

I'm planning to customize MarkLogic default REST rewriter. Want to deploy web 
application inside REST Module database which contains css/images/js and HTML.

Can you help me in writing custom rewriter where i can use both Rest endpoints 
and myapp endpoints. The reason behind this is I want only application-user to 
have access to endpoints and the users should not access the REST apis directly 
( will be checking the token info in custom rewriter )

Regards,
Rajesh
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to