Hi

Am 04.07.2013 um 12:01 schrieb Bertrand Delacretaz:

> Hi Felix,
> 
>> ... have created the Service Authentication concept [1]..
> 
> I like it - here are some comments on the proposed APIs.
> 
> 1) getServiceResourceResolver
> In ResourceResolver getServiceResourceResolver(Map<String, Object>
> authenticationInfo), authenticationInfo MUST contain some attributes,
> wouldn't it be better to use a more specific argument than Map<String,
> Object> ?
> 
> Maybe
> 
>  getServiceResourceResolver(ServicerUserURI uri, Bundle
> serviceBundle, String optionalServiceInfo)

I thougt about having a signature with just the serviceInfo. But the map may 
contain more fields, which are not available in the single signature.

Plus: the only "required" property is the service Info which is optional. The 
bundle is available implicitly and the service base is derived from the bundle 
which is available as the bundle using the ResourceResolverFactory. There is no 
such thing as a freely definable ServiceUserURI: The 
ServiceUserMapper.getServiceName just exists for informational purposes or to 
configure the ServiceUserMapper.

The service name is either the value of the Sling-Service bundle header or the 
bundle symbolic name.

> 
> 2) ServiceUserMapper
> Like Angela I think the naming is a bit confusing, I would suggest having
> 
>  ServicerUserURI - identifies a service, like "service:MailSender:server"
>  userId - a User ID as used by the Sling security services

I don't really see the need to define this as a URI. After all calling this a 
"resource" is kind of esoteric ;-)

How about calling this the service ID comprised of the bundle-derived service 
name and the optional service Info.

Hence how about: ServiceUserMapper.getServiceID ?

Regards
Felix


> 
> You could then have, IIUC
> 
> interface ServiceUserMapper {
>  ServicerUserURI getServiceURI(Bundle b, String serviceName)
>  String getServiceUserID(ServicerUserURI URI, Bundle serviceBundle)
> }
> 
> The main idea is to clearly define what's a service name
> ("mail.sender"), service URI ("service:someBundle:mail.sender") and
> User ID ("mailsender").
> 
> -Bertrand
> 
>> [1] https://cwiki.apache.org/confluence/display/SLING/Service+Authentication

Reply via email to