Yup, that works for me, too.  Thanks.  I didn't know I could do that.

According to the JavaDoc for the "Alias" class, however, it looks like I should 
instead be contributing to the AliasOverrides service, and that does seem to 
work:

"The AliasOverrides service also takes an unordered configuration of 
org.apache.tapestry.services.AliasContribution; such contributions 
override the "factory" contributions to the Alias service itself. This is often 
used to replace built-in service implementations with ones that 
are specific to a particular application."

Franz

----- Original Message ----
From: Robin Helgelin <[EMAIL PROTECTED]>
To: Tapestry users <users@tapestry.apache.org>
Sent: Saturday, February 2, 2008 2:21:05 AM
Subject: Re: T5 tapestry5-acegi salt source not overridable


On 
Jan 
21, 
2008 
7:59 
PM, 
Franz 
Amador 
<[EMAIL PROTECTED]> 
wrote:
> 
It 
looks 
to 
me 
like 
the 
tapestry5-acegi 
module 
hard-codes 
the 
password 
salt 
source 
to 
be 
SystemWideSaltSource.  
I 
can 
change 
the 
system-wide 
salt 
via 
acegi.password.salt, 
but 
there 
is 
no 
corresponding 
acegi.salt.source 
property.  
Having 
a 
system-wide 
salt 
is 
better 
than 
having 
no 
salt, 
but 
it 
isn't 
as 
strong 
as 
having 
a 
different 
salt 
for 
each 
user.  
Is 
there 
a 
way 
I 
can 
put 
in 
a 
request 
for 
supporting 
a 
new 
acegi.salt.source 
config 
property?  
I 
didn't 
see 
a 
mailing 
list 
or 
issue 
tracker 
on 
the 
tapestry5-acegi 
site 
(http://www.localhost.nu/java/tapestry5-acegi/).  
Is 
here 
an 
okay 
place 
to 
discuss 
this?

Hi 
again.

I 
was 
looking 
at 
this 
today, 
and 
can't 
you 
just 
override 
the 
service
by 
contributing 
an 
alias? 
Seems 
to 
work 
for 
me.

This 
is 
from 
my 
test 
application 
AppModule.java 
where 
SaltSourceImpl
is 
a 
quick 
class 
that 
simply 
extends 
SystemWideSaltSource.

  
  
public 
static 
void 
bind(ServiceBinder 
binder) 
{
  
  
  
  
binder.bind(SaltSource.class,
SaltSourceImpl.class).withId("MySaltSource");
  
  
}

  
  
public 
static 
SaltSource 
buildMySaltSource() 
throws 
Exception 
{
  
  
  
  
SaltSourceImpl 
saltSource 
= 
new 
SaltSourceImpl();
  
  
  
  
saltSource.setSystemWideSalt("DEADBEEF");
  
  
  
  
saltSource.afterPropertiesSet();
  
  
  
  
return 
saltSource;
  
  
}

  
  
public 
static 
void 
contributeAlias(@InjectService("MySaltSource")
SaltSource 
saltSource,
  
  
  
  
  
  
Configuration<AliasContribution> 
configuration) 
{
  
  
  
  
configuration.add(AliasContribution.create(SaltSource.class,
saltSource));
  
  
}

Can 
you 
test 
and 
verify 
and 
I'll 
update 
the 
documentation.

-- 
  
  
  
  
regards,
  
  
  
  
Robin

---------------------------------------------------------------------
To 
unsubscribe, 
e-mail: 
[EMAIL PROTECTED]
For 
additional 
commands, 
e-mail: 
[EMAIL PROTECTED]




Reply via email to