Apache karaf has something like this.
It uses a find hook to intercept services and add jaas + ACL based security
checks.

See:
https://github.com/apache/karaf/tree/master/service/guard/src/main/java/org/apache/karaf/service/guard/impl

Actually I think this is something we could also build into felix gogo.

Christian


2018-03-02 7:03 GMT+01:00 David Leangen <[email protected]>:

>
> Hi!
>
> I would like to implement a security feature in the command line, much
> like I would do in a servlet. Is there an easy way to intercept command
> calls so I can wrap each call with the security feature?
>
> Right now, I have to do something like this for each command method in my
> component:
>
> return auth.call( () -> {
>    [code goes here];
> });
>
> It would be preferable to do this just once for all commands, rather than
> having to wrap each command individually. I would prefer not to have to use
> a proxy object (makes it harder to debug) or create my own whiteboard
> service host (a bit heavy-handed, taking the code further away from GOGO).
>
>
> Cheers,
> =David
>
>
>


-- 
-- 
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com

Reply via email to