directory-fortress mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn McKinney <smckin...@apache.org>
Subject Re: REST API request parameters
Date Wed, 09 Dec 2015 17:52:37 GMT

> On Dec 9, 2015, at 8:56 AM, Boris Bobrov <bbobrov@mirantis.com> wrote:
> 
> What could be added is several examples of how the required XML
> should look like along with the list of parameters. I'll try to show
> my logic here.
> 
> For example, there is [0].
> 
> [0]https://directory.apache.org/fortress/gen-docs/latest/apidocs//org/apache/directory/fortress/core/AdminMgr.html#assignUser(org.apache.directory.fortress.core.rbac.UserRole)
> 
> It lists the parameters I need to provide -- role name, user id. How
> do I do it? Where to put these parameters to? I do Python and I don't
> know how things work in Java. Since this is Java, I probably need to
> compose some XML. How should the XML look like?
> 
> I start looking for examples. And, after some digging, found
> fortress-enmasse/src/test/resources/. There I see
> assignEmUser1.xml. OK, it looks simple. But what do I put
> in “xsi:type” attribute? contextId is for multitenancy, right?
> 
> Then I see emTestCheckAccess.xml . There is a bunch of tags, but how do I
> use it in [1]? I don't know.
> 
> [1]https://directory.apache.org/fortress/gen-docs/latest/apidocs//org/apache/directory/fortress/core/AccessMgr.html#checkAccess(org.apache.directory.fortress.core.rbac.Session,%20org.apache.directory.fortress.core.rbac.Permission)
> 
> So, it would be really great to see a manual or a doc describing how to
> translate a Java parameter to an XML tag, with several examples.

I’d be willing to work with you on this.  We can do the first example together.  Once we
see what it takes to provide documentation for a single service, should be doable to extend
to others.  

In the meantime, you can use the fortress core to generate test request/response messages
for example.  You will change this property in the fortress.properties file:

enable.mgr.impl.rest=true
http.user=demouser4
http.pw=password
http.host=localhost
http.port=8080

and run the fortress core console:

mvn test -Pconsole


Which then connects using coordinates in properties.  You can then generate requests using
the console interface and view what gets passed using a wire sniffer or http proxy app.

Not user friendly to be sure, but maybe enough to get you moving again until we get better
documentation...

Shawn


Mime
View raw message