Ok, thanks a lot to Francois and JB. Big Up! @JB, you will let me know if you get it by a "private package".
Le mar. 8 janv. 2019 à 13:40, Jean-Baptiste Onofré <[email protected]> a écrit : > That could work using a private package in "client" bundle. I will check > this afternoon. > > Regards > JB > > On 08/01/2019 12:01, Francois Papon wrote: > > I take a look in the source code of the shiro-jaxrs module and their is > > no maven-bundle-plugin and no MANIFEST in the META-INF. > > > > I think it could be related > > (https://issues.apache.org/jira/browse/SHIRO-650). > > > > Regards, > > > > François Papon > > [email protected] > > > > Le 08/01/2019 à 12:00, Jacques Davidson Erase a écrit : > >> Hi all, > >> @JB > >> do you think that the packages of ShiroModule and ShiroAopModule should > be > >> different from org.apache.shiro.guice.ShiroModule > >> /org.apache.shiro.guice.aop.ShiroAopModule? > >> > >> @François > >> Did you have an idea after seeing the project conception? > >> > >> I stil don't know how can i activate the annotation parser ? > >> > >> Regards, > >> > >> > >> Le lun. 7 janv. 2019 à 14:20, Jean-Baptiste Onofré <[email protected]> a > >> écrit : > >> > >>> Got it. > >>> > >>> I think that the annotation parser is not enabled for your bundle. > >>> > >>> ShiroModule and ShiroAopModule are in the same bundle I guess. What's > >>> the import package header for this module ? > >>> > >>> Regards > >>> JB > >>> > >>> On 07/01/2019 14:11, Jacques Davidson Erase wrote: > >>>> Hi Jean-Baptiste, > >>>> thanks for your answer. No exception thrown, annotations don't work. > But > >>> it > >>>> works only programatically. > >>>> But, i need to use annotations, not programmatically. > >>>> > >>>> Regards, > >>>> > >>>> Le lun. 7 janv. 2019 à 14:08, Jean-Baptiste Onofré <[email protected]> > a > >>>> écrit : > >>>> > >>>>> Hi Jacques, > >>>>> > >>>>> do you any exception or it just doesn't do anything ? > >>>>> > >>>>> Regards > >>>>> JB > >>>>> > >>>>> On 07/01/2019 13:56, Jacques Davidson Erase wrote: > >>>>>> Hi all, > >>>>>> I'm using Apache Shiro v1.4.0, in a karaf 4.2.1. I'm also using > Jax-RS > >>>>> -> > >>>>>> Apache CXF to expose some rest services. I use Shiro to manage roles > >>> and > >>>>>> permissions. > >>>>>> > >>>>>> All this stuf work perfectly but i'd like to use annotation to > handle > >>>>>> permissions/authorisation. > >>>>>> For that, i've created an injector with 2 modules : ShiroModule and > >>>>>> ShiroAopModule like this : > >>>>>> > >>>>>> Injector injector = Guice.createInjector(new ShiroModule() { > >>>>>> @Override > >>>>>> protected void configureShiro() { > >>>>>> try { > >>>>>> bindRealm().toConstructor(IniRealm.class.getConstructor(Ini.class)); > >>>>>> } catch (NoSuchMethodException e) { > >>>>>> addError(e); > >>>>>> } > >>>>>> } > >>>>>> > >>>>>> @Provides > >>>>>> Ini loadShiroIni() { > >>>>>> // Configuration should be datas from a dataBase service > >>>>>> Ini ini = new Ini(); > >>>>>> // Users -and-> password,roles > >>>>>> Map<String, String> users = new HashMap<>(); > >>>>>> users.put("admin", "admin,admin"); > >>>>>> users.put("user", "user,user"); > >>>>>> users.put("guest", "guest,guest"); > >>>>>> ini.addSection("users").putAll(users); > >>>>>> > >>>>>> // Roles -and-> permissions > >>>>>> Map<String, String> roles = new HashMap<>(); > >>>>>> roles.put("admin", "create,read,update,delete"); > >>>>>> roles.put("user", "read,update"); > >>>>>> roles.put("guest", "read"); > >>>>>> ini.addSection("roles").putAll(roles); > >>>>>> > >>>>>> return ini; > >>>>>> } > >>>>>> }, new ShiroAopModule()); > >>>>>> > >>>>>> // Setting a SecurityManager instance > >>>>>> org.apache.shiro.mgt.SecurityManager securityManager = > >>>>>> injector.getInstance(org.apache.shiro.mgt.SecurityManager.class); > >>>>>> SecurityUtils.setSecurityManager(securityManager); > >>>>>> > >>>>>> But the anonnation does not work. Could you help me, please. > >>>>>> > >>>>>> Thanks for any help. > >>>>>> > >>>>>> Best regards. > >>>>>> > >>>>> -- > >>>>> Jean-Baptiste Onofré > >>>>> [email protected] > >>>>> http://blog.nanthrax.net > >>>>> Talend - http://www.talend.com > >>>>> > >>>> > >>> -- > >>> Jean-Baptiste Onofré > >>> [email protected] > >>> http://blog.nanthrax.net > >>> Talend - http://www.talend.com > >>> > >> > > > > -- > Jean-Baptiste Onofré > [email protected] > http://blog.nanthrax.net > Talend - http://www.talend.com > -- _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_ Ce message peut contenir des informations confidentielles dont la divulgation est à ce titre rigoureusement interdite en l'absence d'autorisation explicite de l'émetteur. Dans l'hypothèse où vous auriez reçu par erreur ce message, merci de le renvoyer à l’émetteur et de détruire toute copie. _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
