While looking through
http://www.osgi.org/Download/File?url=/download/osgi-early-draft-2013-03.pdf
to my delight I found that it is adressing the possibility
for a whiteboard to select between multiple HttpServices.
And my main use case (separate HttpServices for Public and
Admin tasks) is even given as example, great!
If I've interpreted the spec text correctly, a given servlet
can then request to be registered in a particular HttpService
by specifying the "osgi.http.whiteboard.service.target"
service property.
If it doesn't specify this property, it may be registered in
any of the available HttpServices.
But this last part is actually making this feature less useful
for the Public/Admin scenario.
The problem is that if the target property is forgotten (by
developer error) on VerySecretAdminService, it may randomly
register in the Public HttpService.
In this scenario, with two distinct HttpServices both aimed
for targeting, I would rather have servlets without target
specification not being registered at all. Better safe than
sorry.
There are several ways to solve this, two that come to mind
are:
1) Add a "requireTarget" boolean property on HttpServices to
say that only servlets with a matching target property may
be registered in it.
2) Add the reverse target construction so that a HttpService
can express a filter on service properties for services it
will accept:
HttpService1
osgi.http.whiteboard.service.target="(SecurityClass=Admin)"
Servlet1
SecurityClass="Admin"
Or are there other ways to solve this scenario?
Thanks
Mike Wilson
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev