ops4j / org.ops4j.pax.exam2

Pax Exam is a testing framework for OSGi
https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/
Apache License 2.0
84 stars 100 forks source link

Support running tests with jaas login (subject.doAs) if user defines @RunAs [PAXEXAM-599] #712

Open ops4j-issues opened 10 years ago

ops4j-issues commented 10 years ago

Christian Schneider created PAXEXAM-599

Karaf 3 contains role based access control which is switched on by default.
It will affect service calls to protected services and karaf commands.

The authorization will require to have done a jaas login in the thread calling a service or command. The user can do this himself with Subject.doAs with a karaf RolePrincipal. This is a little verbose though. So it would be great to have a descriptive approach.

So I propose to allow the use of the standard @RunAs annotation.
So the test class and/or method could be annotated. Pax exam would then have to run the test class or method in subject.doAs with the given role name as karaf RolePrincipal. Then the karaf role based access control should work correctly.


Affects: 3.4.0 Fixed in: 4.x Votes: 2, Watches: 3

ops4j-issues commented 10 years ago

Jean-Baptiste Onofre commented

+1