You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by Jacques Davidson Erase <er...@gmail.com> on 2019/01/07 12:56:36 UTC

Annotations with Apache Shiro v1.4.0

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.

Re: Annotations with Apache Shiro v1.4.0

Posted by Francois Papon <fr...@openobject.fr>.
Hi,

Could you share your project?

Regards,

François Papon
fpapon@apache.org

Le 07/01/2019 à 16:56, Jacques Davidson Erase a écrit :
> 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.
>

Re: Annotations with Apache Shiro v1.4.0

Posted by Jacques Davidson Erase <er...@gmail.com>.
If if put any Apache Shiro Annotation in one of this interfaces,
(RightCheckingService & RightCheckingEndPoint), it does not work.

Le lun. 7 janv. 2019 à 14:27, Jacques Davidson Erase <er...@gmail.com>
a écrit :

> There is my project . Attached File.
> Have a look inside and thank in advance, if you find out what is wrong.
>
>
> Le lun. 7 janv. 2019 à 14:20, Jean-Baptiste Onofré <jb...@nanthrax.net> 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é <jb...@nanthrax.net> 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é
>> >> jbonofre@apache.org
>> >> http://blog.nanthrax.net
>> >> Talend - http://www.talend.com
>> >>
>> >
>> >
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> 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.
> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
>


-- 
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
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.
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_

Re: Annotations with Apache Shiro v1.4.0

Posted by Jacques Davidson Erase <er...@gmail.com>.
There is my project . Attached File.
Have a look inside and thank in advance, if you find out what is wrong.


Le lun. 7 janv. 2019 à 14:20, Jean-Baptiste Onofré <jb...@nanthrax.net> 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é <jb...@nanthrax.net> 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é
> >> jbonofre@apache.org
> >> http://blog.nanthrax.net
> >> Talend - http://www.talend.com
> >>
> >
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> 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.
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_

Re: Annotations with Apache Shiro v1.4.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Jacques,

Sorry for the delay, I will take a look ;)

Regards
JB

On 31/01/2019 14:54, Jacques Davidson Erase wrote:
> Hello all,
> Thank you for the help. I can get the binary libraries now, for
> 1.4.1-SNAPSHOT.
> 
> I tried to test my projet but the Shiro annotations stil don't work.
> It seems that Shiro does not fit well with CXF of DOSGI. Am i wrong ?
> 
> Regards,
> 
> 
> Le mar. 29 janv. 2019 à 18:17, Jean-Baptiste Onofré <jb...@nanthrax.net> a
> écrit :
> 
>> Hi Jacques,
>>
>> you have to add the Apache SNAPSHOT repo:
>>
>> https://repository.apache.org/content/groups/snapshots/
>>
>> Let me know if you need help.
>>
>> Regards
>> JB
>>
>> On 29/01/2019 16:59, Jacques Davidson Erase wrote:
>>> Hi François,
>>> thanks for the answer. But i cannot download the
>>> shiro-guice:jar:1.4.1-SNAPSHOT, with maven.
>>>
>>> Are your sure that all the binary libraries are available for the
>>> 1.4.1-SNAPSHOT version ?
>>>
>>> Regards, Jacques.
>>>
>>>
>>> Le mar. 22 janv. 2019 à 07:25, Francois Papon <
>> francois.papon@openobject.fr>
>>> a écrit :
>>>
>>>> Hi Jacques,
>>>>
>>>> I added the maven-bundle-plugin to the JaxRS Shiro module and merged it
>>>> on master.
>>>>
>>>> You can try with the 1.4.1-SNAPSHOT?
>>>>
>>>> Regards,
>>>>
>>>> François Papon
>>>> fpapon@apache.org
>>>>
>>>> Le 21/01/2019 à 14:45, Jacques Davidson Erase a écrit :
>>>>> Hello all,
>>>>> How are you doing ?
>>>>>
>>>>> Has anyone of you tried to point out what is wrong with my problem
>> about
>>>>> Shiro annotations ?
>>>>>
>>>>> Thank you.
>>>>>
>>>>>
>>>>> Le jeu. 10 janv. 2019 à 09:09, Jean-Baptiste Onofré <jb...@nanthrax.net>
>> a
>>>>> écrit :
>>>>>
>>>>>> Hi Jacques,
>>>>>>
>>>>>> and sorry, I was completely swamped with Karaf stuff.
>>>>>>
>>>>>> Let me try to move forward today and tomorrow on your issue.
>>>>>>
>>>>>> By the way, any chance to have direct chat (on hangout, slack or
>>>>>> whatever) ? If possible, please, ping me with private message.
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>>>>
>>>>>> On 10/01/2019 09:06, Jacques Davidson Erase wrote:
>>>>>>> Hello all,
>>>>>>> Do you think it's possible to activate the annotations parser for my
>>>>>>> project ?
>>>>>>>
>>>>>>> I have read many pages and looked so many samples, i could not find
>> any
>>>>>>> example running on karaf with apache cxf.
>>>>>>>
>>>>>>> Thanks for any little help.
>>>>>>>
>>>>>>>
>>>>>>> Le mar. 8 janv. 2019 à 14:06, Jacques Davidson Erase <
>>>>>> erasedave@gmail.com>
>>>>>>> a écrit :
>>>>>>>
>>>>>>>> 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é <jb@nanthrax.net
>>>
>>>> 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
>>>>>>>>>> fpapon@apache.org
>>>>>>>>>>
>>>>>>>>>> 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é <
>>>> jb@nanthrax.net>
>>>>>> 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é <
>>>>>> jb@nanthrax.net>
>>>>>>>>> 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é
>>>>>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>>>>>> http://blog.nanthrax.net
>>>>>>>>>>>>>> Talend - http://www.talend.com
>>>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> Jean-Baptiste Onofré
>>>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>>>> http://blog.nanthrax.net
>>>>>>>>>>>> Talend - http://www.talend.com
>>>>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Jean-Baptiste Onofré
>>>>>>>>> jbonofre@apache.org
>>>>>>>>> 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.
>>>>>>>> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
>>>>>>>>
>>>>>>>
>>>>>> --
>>>>>> Jean-Baptiste Onofré
>>>>>> jbonofre@apache.org
>>>>>> http://blog.nanthrax.net
>>>>>> Talend - http://www.talend.com
>>>>>>
>>>>>
>>>>
>>>
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
> 
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Annotations with Apache Shiro v1.4.0

Posted by Jacques Davidson Erase <er...@gmail.com>.
Hello all,
Thank you for the help. I can get the binary libraries now, for
1.4.1-SNAPSHOT.

I tried to test my projet but the Shiro annotations stil don't work.
It seems that Shiro does not fit well with CXF of DOSGI. Am i wrong ?

Regards,


Le mar. 29 janv. 2019 à 18:17, Jean-Baptiste Onofré <jb...@nanthrax.net> a
écrit :

> Hi Jacques,
>
> you have to add the Apache SNAPSHOT repo:
>
> https://repository.apache.org/content/groups/snapshots/
>
> Let me know if you need help.
>
> Regards
> JB
>
> On 29/01/2019 16:59, Jacques Davidson Erase wrote:
> > Hi François,
> > thanks for the answer. But i cannot download the
> > shiro-guice:jar:1.4.1-SNAPSHOT, with maven.
> >
> > Are your sure that all the binary libraries are available for the
> > 1.4.1-SNAPSHOT version ?
> >
> > Regards, Jacques.
> >
> >
> > Le mar. 22 janv. 2019 à 07:25, Francois Papon <
> francois.papon@openobject.fr>
> > a écrit :
> >
> >> Hi Jacques,
> >>
> >> I added the maven-bundle-plugin to the JaxRS Shiro module and merged it
> >> on master.
> >>
> >> You can try with the 1.4.1-SNAPSHOT?
> >>
> >> Regards,
> >>
> >> François Papon
> >> fpapon@apache.org
> >>
> >> Le 21/01/2019 à 14:45, Jacques Davidson Erase a écrit :
> >>> Hello all,
> >>> How are you doing ?
> >>>
> >>> Has anyone of you tried to point out what is wrong with my problem
> about
> >>> Shiro annotations ?
> >>>
> >>> Thank you.
> >>>
> >>>
> >>> Le jeu. 10 janv. 2019 à 09:09, Jean-Baptiste Onofré <jb...@nanthrax.net>
> a
> >>> écrit :
> >>>
> >>>> Hi Jacques,
> >>>>
> >>>> and sorry, I was completely swamped with Karaf stuff.
> >>>>
> >>>> Let me try to move forward today and tomorrow on your issue.
> >>>>
> >>>> By the way, any chance to have direct chat (on hangout, slack or
> >>>> whatever) ? If possible, please, ping me with private message.
> >>>>
> >>>> Regards
> >>>> JB
> >>>>
> >>>> On 10/01/2019 09:06, Jacques Davidson Erase wrote:
> >>>>> Hello all,
> >>>>> Do you think it's possible to activate the annotations parser for my
> >>>>> project ?
> >>>>>
> >>>>> I have read many pages and looked so many samples, i could not find
> any
> >>>>> example running on karaf with apache cxf.
> >>>>>
> >>>>> Thanks for any little help.
> >>>>>
> >>>>>
> >>>>> Le mar. 8 janv. 2019 à 14:06, Jacques Davidson Erase <
> >>>> erasedave@gmail.com>
> >>>>> a écrit :
> >>>>>
> >>>>>> 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é <jb@nanthrax.net
> >
> >> 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
> >>>>>>>> fpapon@apache.org
> >>>>>>>>
> >>>>>>>> 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é <
> >> jb@nanthrax.net>
> >>>> 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é <
> >>>> jb@nanthrax.net>
> >>>>>>> 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é
> >>>>>>>>>>>> jbonofre@apache.org
> >>>>>>>>>>>> http://blog.nanthrax.net
> >>>>>>>>>>>> Talend - http://www.talend.com
> >>>>>>>>>>>>
> >>>>>>>>>> --
> >>>>>>>>>> Jean-Baptiste Onofré
> >>>>>>>>>> jbonofre@apache.org
> >>>>>>>>>> http://blog.nanthrax.net
> >>>>>>>>>> Talend - http://www.talend.com
> >>>>>>>>>>
> >>>>>>> --
> >>>>>>> Jean-Baptiste Onofré
> >>>>>>> jbonofre@apache.org
> >>>>>>> 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.
> >>>>>> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
> >>>>>>
> >>>>>
> >>>> --
> >>>> Jean-Baptiste Onofré
> >>>> jbonofre@apache.org
> >>>> http://blog.nanthrax.net
> >>>> Talend - http://www.talend.com
> >>>>
> >>>
> >>
> >
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> 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.
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_

Re: Annotations with Apache Shiro v1.4.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Jacques,

you have to add the Apache SNAPSHOT repo:

https://repository.apache.org/content/groups/snapshots/

Let me know if you need help.

Regards
JB

On 29/01/2019 16:59, Jacques Davidson Erase wrote:
> Hi François,
> thanks for the answer. But i cannot download the
> shiro-guice:jar:1.4.1-SNAPSHOT, with maven.
> 
> Are your sure that all the binary libraries are available for the
> 1.4.1-SNAPSHOT version ?
> 
> Regards, Jacques.
> 
> 
> Le mar. 22 janv. 2019 à 07:25, Francois Papon <fr...@openobject.fr>
> a écrit :
> 
>> Hi Jacques,
>>
>> I added the maven-bundle-plugin to the JaxRS Shiro module and merged it
>> on master.
>>
>> You can try with the 1.4.1-SNAPSHOT?
>>
>> Regards,
>>
>> François Papon
>> fpapon@apache.org
>>
>> Le 21/01/2019 à 14:45, Jacques Davidson Erase a écrit :
>>> Hello all,
>>> How are you doing ?
>>>
>>> Has anyone of you tried to point out what is wrong with my problem about
>>> Shiro annotations ?
>>>
>>> Thank you.
>>>
>>>
>>> Le jeu. 10 janv. 2019 à 09:09, Jean-Baptiste Onofré <jb...@nanthrax.net> a
>>> écrit :
>>>
>>>> Hi Jacques,
>>>>
>>>> and sorry, I was completely swamped with Karaf stuff.
>>>>
>>>> Let me try to move forward today and tomorrow on your issue.
>>>>
>>>> By the way, any chance to have direct chat (on hangout, slack or
>>>> whatever) ? If possible, please, ping me with private message.
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 10/01/2019 09:06, Jacques Davidson Erase wrote:
>>>>> Hello all,
>>>>> Do you think it's possible to activate the annotations parser for my
>>>>> project ?
>>>>>
>>>>> I have read many pages and looked so many samples, i could not find any
>>>>> example running on karaf with apache cxf.
>>>>>
>>>>> Thanks for any little help.
>>>>>
>>>>>
>>>>> Le mar. 8 janv. 2019 à 14:06, Jacques Davidson Erase <
>>>> erasedave@gmail.com>
>>>>> a écrit :
>>>>>
>>>>>> 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é <jb...@nanthrax.net>
>> 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
>>>>>>>> fpapon@apache.org
>>>>>>>>
>>>>>>>> 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é <
>> jb@nanthrax.net>
>>>> 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é <
>>>> jb@nanthrax.net>
>>>>>>> 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é
>>>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>>>> http://blog.nanthrax.net
>>>>>>>>>>>> Talend - http://www.talend.com
>>>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Jean-Baptiste Onofré
>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>> http://blog.nanthrax.net
>>>>>>>>>> Talend - http://www.talend.com
>>>>>>>>>>
>>>>>>> --
>>>>>>> Jean-Baptiste Onofré
>>>>>>> jbonofre@apache.org
>>>>>>> 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.
>>>>>> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
>>>>>>
>>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>
>>
> 
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Annotations with Apache Shiro v1.4.0

Posted by Tamás Cservenák <ta...@cservenak.net>.
1.4.1-SNAP is there
https://repository.apache.org/content/repositories/snapshots/org/apache/shiro/shiro-core/1.4.1-SNAPSHOT/

you need to add apache snapshot repo and pull from there, or better: build
1,4.1-SNAP locally.

HTH,
T

On Tue, Jan 29, 2019 at 4:59 PM Jacques Davidson Erase <er...@gmail.com>
wrote:

> Hi François,
> thanks for the answer. But i cannot download the
> shiro-guice:jar:1.4.1-SNAPSHOT, with maven.
>
> Are your sure that all the binary libraries are available for the
> 1.4.1-SNAPSHOT version ?
>
> Regards, Jacques.
>
>
> Le mar. 22 janv. 2019 à 07:25, Francois Papon <
> francois.papon@openobject.fr>
> a écrit :
>
> > Hi Jacques,
> >
> > I added the maven-bundle-plugin to the JaxRS Shiro module and merged it
> > on master.
> >
> > You can try with the 1.4.1-SNAPSHOT?
> >
> > Regards,
> >
> > François Papon
> > fpapon@apache.org
> >
> > Le 21/01/2019 à 14:45, Jacques Davidson Erase a écrit :
> > > Hello all,
> > > How are you doing ?
> > >
> > > Has anyone of you tried to point out what is wrong with my problem
> about
> > > Shiro annotations ?
> > >
> > > Thank you.
> > >
> > >
> > > Le jeu. 10 janv. 2019 à 09:09, Jean-Baptiste Onofré <jb...@nanthrax.net>
> a
> > > écrit :
> > >
> > >> Hi Jacques,
> > >>
> > >> and sorry, I was completely swamped with Karaf stuff.
> > >>
> > >> Let me try to move forward today and tomorrow on your issue.
> > >>
> > >> By the way, any chance to have direct chat (on hangout, slack or
> > >> whatever) ? If possible, please, ping me with private message.
> > >>
> > >> Regards
> > >> JB
> > >>
> > >> On 10/01/2019 09:06, Jacques Davidson Erase wrote:
> > >>> Hello all,
> > >>> Do you think it's possible to activate the annotations parser for my
> > >>> project ?
> > >>>
> > >>> I have read many pages and looked so many samples, i could not find
> any
> > >>> example running on karaf with apache cxf.
> > >>>
> > >>> Thanks for any little help.
> > >>>
> > >>>
> > >>> Le mar. 8 janv. 2019 à 14:06, Jacques Davidson Erase <
> > >> erasedave@gmail.com>
> > >>> a écrit :
> > >>>
> > >>>> 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é <jb@nanthrax.net
> >
> > 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
> > >>>>>> fpapon@apache.org
> > >>>>>>
> > >>>>>> 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é <
> > jb@nanthrax.net>
> > >> 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é <
> > >> jb@nanthrax.net>
> > >>>>> 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é
> > >>>>>>>>>> jbonofre@apache.org
> > >>>>>>>>>> http://blog.nanthrax.net
> > >>>>>>>>>> Talend - http://www.talend.com
> > >>>>>>>>>>
> > >>>>>>>> --
> > >>>>>>>> Jean-Baptiste Onofré
> > >>>>>>>> jbonofre@apache.org
> > >>>>>>>> http://blog.nanthrax.net
> > >>>>>>>> Talend - http://www.talend.com
> > >>>>>>>>
> > >>>>> --
> > >>>>> Jean-Baptiste Onofré
> > >>>>> jbonofre@apache.org
> > >>>>> 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.
> > >>>> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
> > >>>>
> > >>>
> > >> --
> > >> Jean-Baptiste Onofré
> > >> jbonofre@apache.org
> > >> 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.
> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
>

Re: Annotations with Apache Shiro v1.4.0

Posted by Brian Demers <br...@gmail.com>.
Are you using this repo?
 https://repository.apache.org/content/groups/snapshots/

On Tue, Jan 29, 2019 at 10:59 AM Jacques Davidson Erase <er...@gmail.com>
wrote:

> Hi François,
> thanks for the answer. But i cannot download the
> shiro-guice:jar:1.4.1-SNAPSHOT, with maven.
>
> Are your sure that all the binary libraries are available for the
> 1.4.1-SNAPSHOT version ?
>
> Regards, Jacques.
>
>
> Le mar. 22 janv. 2019 à 07:25, Francois Papon <
> francois.papon@openobject.fr>
> a écrit :
>
> > Hi Jacques,
> >
> > I added the maven-bundle-plugin to the JaxRS Shiro module and merged it
> > on master.
> >
> > You can try with the 1.4.1-SNAPSHOT?
> >
> > Regards,
> >
> > François Papon
> > fpapon@apache.org
> >
> > Le 21/01/2019 à 14:45, Jacques Davidson Erase a écrit :
> > > Hello all,
> > > How are you doing ?
> > >
> > > Has anyone of you tried to point out what is wrong with my problem
> about
> > > Shiro annotations ?
> > >
> > > Thank you.
> > >
> > >
> > > Le jeu. 10 janv. 2019 à 09:09, Jean-Baptiste Onofré <jb...@nanthrax.net>
> a
> > > écrit :
> > >
> > >> Hi Jacques,
> > >>
> > >> and sorry, I was completely swamped with Karaf stuff.
> > >>
> > >> Let me try to move forward today and tomorrow on your issue.
> > >>
> > >> By the way, any chance to have direct chat (on hangout, slack or
> > >> whatever) ? If possible, please, ping me with private message.
> > >>
> > >> Regards
> > >> JB
> > >>
> > >> On 10/01/2019 09:06, Jacques Davidson Erase wrote:
> > >>> Hello all,
> > >>> Do you think it's possible to activate the annotations parser for my
> > >>> project ?
> > >>>
> > >>> I have read many pages and looked so many samples, i could not find
> any
> > >>> example running on karaf with apache cxf.
> > >>>
> > >>> Thanks for any little help.
> > >>>
> > >>>
> > >>> Le mar. 8 janv. 2019 à 14:06, Jacques Davidson Erase <
> > >> erasedave@gmail.com>
> > >>> a écrit :
> > >>>
> > >>>> 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é <jb@nanthrax.net
> >
> > 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
> > >>>>>> fpapon@apache.org
> > >>>>>>
> > >>>>>> 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é <
> > jb@nanthrax.net>
> > >> 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é <
> > >> jb@nanthrax.net>
> > >>>>> 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é
> > >>>>>>>>>> jbonofre@apache.org
> > >>>>>>>>>> http://blog.nanthrax.net
> > >>>>>>>>>> Talend - http://www.talend.com
> > >>>>>>>>>>
> > >>>>>>>> --
> > >>>>>>>> Jean-Baptiste Onofré
> > >>>>>>>> jbonofre@apache.org
> > >>>>>>>> http://blog.nanthrax.net
> > >>>>>>>> Talend - http://www.talend.com
> > >>>>>>>>
> > >>>>> --
> > >>>>> Jean-Baptiste Onofré
> > >>>>> jbonofre@apache.org
> > >>>>> 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.
> > >>>> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
> > >>>>
> > >>>
> > >> --
> > >> Jean-Baptiste Onofré
> > >> jbonofre@apache.org
> > >> 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.
> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
>

Re: Annotations with Apache Shiro v1.4.0

Posted by Jacques Davidson Erase <er...@gmail.com>.
Hi François,
thanks for the answer. But i cannot download the
shiro-guice:jar:1.4.1-SNAPSHOT, with maven.

Are your sure that all the binary libraries are available for the
1.4.1-SNAPSHOT version ?

Regards, Jacques.


Le mar. 22 janv. 2019 à 07:25, Francois Papon <fr...@openobject.fr>
a écrit :

> Hi Jacques,
>
> I added the maven-bundle-plugin to the JaxRS Shiro module and merged it
> on master.
>
> You can try with the 1.4.1-SNAPSHOT?
>
> Regards,
>
> François Papon
> fpapon@apache.org
>
> Le 21/01/2019 à 14:45, Jacques Davidson Erase a écrit :
> > Hello all,
> > How are you doing ?
> >
> > Has anyone of you tried to point out what is wrong with my problem about
> > Shiro annotations ?
> >
> > Thank you.
> >
> >
> > Le jeu. 10 janv. 2019 à 09:09, Jean-Baptiste Onofré <jb...@nanthrax.net> a
> > écrit :
> >
> >> Hi Jacques,
> >>
> >> and sorry, I was completely swamped with Karaf stuff.
> >>
> >> Let me try to move forward today and tomorrow on your issue.
> >>
> >> By the way, any chance to have direct chat (on hangout, slack or
> >> whatever) ? If possible, please, ping me with private message.
> >>
> >> Regards
> >> JB
> >>
> >> On 10/01/2019 09:06, Jacques Davidson Erase wrote:
> >>> Hello all,
> >>> Do you think it's possible to activate the annotations parser for my
> >>> project ?
> >>>
> >>> I have read many pages and looked so many samples, i could not find any
> >>> example running on karaf with apache cxf.
> >>>
> >>> Thanks for any little help.
> >>>
> >>>
> >>> Le mar. 8 janv. 2019 à 14:06, Jacques Davidson Erase <
> >> erasedave@gmail.com>
> >>> a écrit :
> >>>
> >>>> 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é <jb...@nanthrax.net>
> 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
> >>>>>> fpapon@apache.org
> >>>>>>
> >>>>>> 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é <
> jb@nanthrax.net>
> >> 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é <
> >> jb@nanthrax.net>
> >>>>> 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é
> >>>>>>>>>> jbonofre@apache.org
> >>>>>>>>>> http://blog.nanthrax.net
> >>>>>>>>>> Talend - http://www.talend.com
> >>>>>>>>>>
> >>>>>>>> --
> >>>>>>>> Jean-Baptiste Onofré
> >>>>>>>> jbonofre@apache.org
> >>>>>>>> http://blog.nanthrax.net
> >>>>>>>> Talend - http://www.talend.com
> >>>>>>>>
> >>>>> --
> >>>>> Jean-Baptiste Onofré
> >>>>> jbonofre@apache.org
> >>>>> 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.
> >>>> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
> >>>>
> >>>
> >> --
> >> Jean-Baptiste Onofré
> >> jbonofre@apache.org
> >> 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.
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_

Re: Annotations with Apache Shiro v1.4.0

Posted by Francois Papon <fr...@openobject.fr>.
Hi Jacques,

I added the maven-bundle-plugin to the JaxRS Shiro module and merged it
on master.

You can try with the 1.4.1-SNAPSHOT?

Regards,

François Papon
fpapon@apache.org

Le 21/01/2019 à 14:45, Jacques Davidson Erase a écrit :
> Hello all,
> How are you doing ?
>
> Has anyone of you tried to point out what is wrong with my problem about
> Shiro annotations ?
>
> Thank you.
>
>
> Le jeu. 10 janv. 2019 à 09:09, Jean-Baptiste Onofré <jb...@nanthrax.net> a
> écrit :
>
>> Hi Jacques,
>>
>> and sorry, I was completely swamped with Karaf stuff.
>>
>> Let me try to move forward today and tomorrow on your issue.
>>
>> By the way, any chance to have direct chat (on hangout, slack or
>> whatever) ? If possible, please, ping me with private message.
>>
>> Regards
>> JB
>>
>> On 10/01/2019 09:06, Jacques Davidson Erase wrote:
>>> Hello all,
>>> Do you think it's possible to activate the annotations parser for my
>>> project ?
>>>
>>> I have read many pages and looked so many samples, i could not find any
>>> example running on karaf with apache cxf.
>>>
>>> Thanks for any little help.
>>>
>>>
>>> Le mar. 8 janv. 2019 à 14:06, Jacques Davidson Erase <
>> erasedave@gmail.com>
>>> a écrit :
>>>
>>>> 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é <jb...@nanthrax.net> 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
>>>>>> fpapon@apache.org
>>>>>>
>>>>>> 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é <jb...@nanthrax.net>
>> 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é <
>> jb@nanthrax.net>
>>>>> 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é
>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>> http://blog.nanthrax.net
>>>>>>>>>> Talend - http://www.talend.com
>>>>>>>>>>
>>>>>>>> --
>>>>>>>> Jean-Baptiste Onofré
>>>>>>>> jbonofre@apache.org
>>>>>>>> http://blog.nanthrax.net
>>>>>>>> Talend - http://www.talend.com
>>>>>>>>
>>>>> --
>>>>> Jean-Baptiste Onofré
>>>>> jbonofre@apache.org
>>>>> 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.
>>>> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
>>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>

Re: Annotations with Apache Shiro v1.4.0

Posted by Jacques Davidson Erase <er...@gmail.com>.
Hello all,
How are you doing ?

Has anyone of you tried to point out what is wrong with my problem about
Shiro annotations ?

Thank you.


Le jeu. 10 janv. 2019 à 09:09, Jean-Baptiste Onofré <jb...@nanthrax.net> a
écrit :

> Hi Jacques,
>
> and sorry, I was completely swamped with Karaf stuff.
>
> Let me try to move forward today and tomorrow on your issue.
>
> By the way, any chance to have direct chat (on hangout, slack or
> whatever) ? If possible, please, ping me with private message.
>
> Regards
> JB
>
> On 10/01/2019 09:06, Jacques Davidson Erase wrote:
> > Hello all,
> > Do you think it's possible to activate the annotations parser for my
> > project ?
> >
> > I have read many pages and looked so many samples, i could not find any
> > example running on karaf with apache cxf.
> >
> > Thanks for any little help.
> >
> >
> > Le mar. 8 janv. 2019 à 14:06, Jacques Davidson Erase <
> erasedave@gmail.com>
> > a écrit :
> >
> >> 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é <jb...@nanthrax.net> 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
> >>>> fpapon@apache.org
> >>>>
> >>>> 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é <jb...@nanthrax.net>
> 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é <
> jb@nanthrax.net>
> >>> 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é
> >>>>>>>> jbonofre@apache.org
> >>>>>>>> http://blog.nanthrax.net
> >>>>>>>> Talend - http://www.talend.com
> >>>>>>>>
> >>>>>>>
> >>>>>> --
> >>>>>> Jean-Baptiste Onofré
> >>>>>> jbonofre@apache.org
> >>>>>> http://blog.nanthrax.net
> >>>>>> Talend - http://www.talend.com
> >>>>>>
> >>>>>
> >>>>
> >>>
> >>> --
> >>> Jean-Baptiste Onofré
> >>> jbonofre@apache.org
> >>> 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.
> >> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
> >>
> >
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> 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.
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_

Re: Annotations with Apache Shiro v1.4.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Jacques,

and sorry, I was completely swamped with Karaf stuff.

Let me try to move forward today and tomorrow on your issue.

By the way, any chance to have direct chat (on hangout, slack or
whatever) ? If possible, please, ping me with private message.

Regards
JB

On 10/01/2019 09:06, Jacques Davidson Erase wrote:
> Hello all,
> Do you think it's possible to activate the annotations parser for my
> project ?
> 
> I have read many pages and looked so many samples, i could not find any
> example running on karaf with apache cxf.
> 
> Thanks for any little help.
> 
> 
> Le mar. 8 janv. 2019 à 14:06, Jacques Davidson Erase <er...@gmail.com>
> a écrit :
> 
>> 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é <jb...@nanthrax.net> 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
>>>> fpapon@apache.org
>>>>
>>>> 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é <jb...@nanthrax.net> 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é <jb...@nanthrax.net>
>>> 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é
>>>>>>>> jbonofre@apache.org
>>>>>>>> http://blog.nanthrax.net
>>>>>>>> Talend - http://www.talend.com
>>>>>>>>
>>>>>>>
>>>>>> --
>>>>>> Jean-Baptiste Onofré
>>>>>> jbonofre@apache.org
>>>>>> http://blog.nanthrax.net
>>>>>> Talend - http://www.talend.com
>>>>>>
>>>>>
>>>>
>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> 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.
>> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
>>
> 
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Annotations with Apache Shiro v1.4.0

Posted by Jacques Davidson Erase <er...@gmail.com>.
Hello all,
Do you think it's possible to activate the annotations parser for my
project ?

I have read many pages and looked so many samples, i could not find any
example running on karaf with apache cxf.

Thanks for any little help.


Le mar. 8 janv. 2019 à 14:06, Jacques Davidson Erase <er...@gmail.com>
a écrit :

> 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é <jb...@nanthrax.net> 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
>> > fpapon@apache.org
>> >
>> > 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é <jb...@nanthrax.net> 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é <jb...@nanthrax.net>
>> 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é
>> >>>>> jbonofre@apache.org
>> >>>>> http://blog.nanthrax.net
>> >>>>> Talend - http://www.talend.com
>> >>>>>
>> >>>>
>> >>> --
>> >>> Jean-Baptiste Onofré
>> >>> jbonofre@apache.org
>> >>> http://blog.nanthrax.net
>> >>> Talend - http://www.talend.com
>> >>>
>> >>
>> >
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> 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.
> _*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
>


-- 
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_
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.
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_

Re: Annotations with Apache Shiro v1.4.0

Posted by Jacques Davidson Erase <er...@gmail.com>.
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é <jb...@nanthrax.net> 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
> > fpapon@apache.org
> >
> > 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é <jb...@nanthrax.net> 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é <jb...@nanthrax.net>
> 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é
> >>>>> jbonofre@apache.org
> >>>>> http://blog.nanthrax.net
> >>>>> Talend - http://www.talend.com
> >>>>>
> >>>>
> >>> --
> >>> Jean-Baptiste Onofré
> >>> jbonofre@apache.org
> >>> http://blog.nanthrax.net
> >>> Talend - http://www.talend.com
> >>>
> >>
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> 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.
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_

Re: Annotations with Apache Shiro v1.4.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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
> fpapon@apache.org
> 
> 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é <jb...@nanthrax.net> 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é <jb...@nanthrax.net> 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é
>>>>> jbonofre@apache.org
>>>>> http://blog.nanthrax.net
>>>>> Talend - http://www.talend.com
>>>>>
>>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Annotations with Apache Shiro v1.4.0

Posted by Francois Papon <fr...@openobject.fr>.
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
fpapon@apache.org

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é <jb...@nanthrax.net> 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é <jb...@nanthrax.net> 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é
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>


Re: Annotations with Apache Shiro v1.4.0

Posted by Francois Papon <fr...@openobject.fr>.
Hi,

Sorry, I don't already have the time to look at the source code...

Regards,

François Papon
fpapon@apache.org

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é <jb...@nanthrax.net> 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é <jb...@nanthrax.net> 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é
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>

Re: Annotations with Apache Shiro v1.4.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Jacques,

as you shared the project, I will take a look later today (I have some
Karaf stuff to complete this morning first).

I keep you posted.

Regards
JB

On 08/01/2019 09:00, Jacques Davidson Erase wrote:
> 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é <jb...@nanthrax.net> 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é <jb...@nanthrax.net> 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é
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
> 
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Annotations with Apache Shiro v1.4.0

Posted by Jacques Davidson Erase <er...@gmail.com>.
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é <jb...@nanthrax.net> 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é <jb...@nanthrax.net> 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é
> >> jbonofre@apache.org
> >> http://blog.nanthrax.net
> >> Talend - http://www.talend.com
> >>
> >
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> 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.
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_

Re: Annotations with Apache Shiro v1.4.0

Posted by Jacques Davidson Erase <er...@gmail.com>.
Hello JB,
The import packages are :
import org.apache.shiro.guice.ShiroModule;
import org.apache.shiro.guice.aop.ShiroAopModule;

Regards,


Le lun. 7 janv. 2019 à 14:20, Jean-Baptiste Onofré <jb...@nanthrax.net> 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é <jb...@nanthrax.net> 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é
> >> jbonofre@apache.org
> >> http://blog.nanthrax.net
> >> Talend - http://www.talend.com
> >>
> >
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> 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.
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_

Re: Annotations with Apache Shiro v1.4.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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é <jb...@nanthrax.net> 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é
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
> 
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Annotations with Apache Shiro v1.4.0

Posted by Jacques Davidson Erase <er...@gmail.com>.
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é <jb...@nanthrax.net> 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é
> jbonofre@apache.org
> 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.
_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_

Re: Annotations with Apache Shiro v1.4.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com