You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by alphasparc <al...@gmail.com> on 2011/09/29 05:33:32 UTC
Embedding Felix Security
Hi,
I am trying to embbed Felix into an Application but I have ran into problems
with the security aspects.
How is the ConditionPermissionAdmin Service actually done?
I have the bundle and install it into the felix framework but at which point
do I actually add the code for conditionpermissionadmin?
When I tried to add it in the felix framework
ConditionalPermissionAdmin cpa = null;
ConditionalPermissionUpdate u =
cpa.newConditionalPermissionUpdate();
List infos = u.getConditionalPermissionInfos();
infos.clear();
infos.add(
cpa.newConditionalPermissionInfo(null,
new ConditionInfo[]{
new ConditionInfo(
BundleLocationCondition.class.getName(), new
String[]{"file:./Bundles/SignedBundleTest.jar"})
},
new PermissionInfo[]{
new
PermissionInfo(FilePermission.class.getName(), "<<ALL FILES>>",
"read,write,delete"),
new
PermissionInfo(NetPermission.class.getName(), "*", "")
},
ConditionalPermissionInfo.DENY));
u.commit();
When I try to run it, it throws java.lang.NullPointerException for all the
Bundles.
--
View this message in context: http://old.nabble.com/Embedding-Felix-Security-tp32550699p32550699.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Embedding Felix Security
Posted by "Richard S. Hall" <he...@ungoverned.org>.
When you install the security provider, it will add a
ConditionalPermissionAdmin service to the service registry. At that
point, you just look it up and use it like any other service. In the
code below, you don't actually show it looking up the service.
-> richard
On 9/28/11 11:33 PM, alphasparc wrote:
> Hi,
> I am trying to embbed Felix into an Application but I have ran into problems
> with the security aspects.
> How is the ConditionPermissionAdmin Service actually done?
> I have the bundle and install it into the felix framework but at which point
> do I actually add the code for conditionpermissionadmin?
> When I tried to add it in the felix framework
>
> ConditionalPermissionAdmin cpa = null;
> ConditionalPermissionUpdate u =
> cpa.newConditionalPermissionUpdate();
> List infos = u.getConditionalPermissionInfos();
> infos.clear();
> infos.add(
> cpa.newConditionalPermissionInfo(null,
> new ConditionInfo[]{
> new ConditionInfo(
> BundleLocationCondition.class.getName(), new
> String[]{"file:./Bundles/SignedBundleTest.jar"})
> },
> new PermissionInfo[]{
> new
> PermissionInfo(FilePermission.class.getName(), "<<ALL FILES>>",
> "read,write,delete"),
> new
> PermissionInfo(NetPermission.class.getName(), "*", "")
> },
> ConditionalPermissionInfo.DENY));
> u.commit();
>
> When I try to run it, it throws java.lang.NullPointerException for all the
> Bundles.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org