attributes per request and testing

1 view
Skip to first unread message

Marc

unread,
Dec 7, 2009, 6:15:05 AM12/7/09
to dyuproject
I've been testing dyuproject and run into two issues:

1. Attribute exchange per request
If I understand RelyingParty correctly, attribute exchange can only be
configured on a global level with RelyingParty.addListener(). This is
very unfortunate for my use case as I basically only need attributes
with the first login of a new user. Is there a way to configure
attributes on a per request basis?

2. Unit testing
I wonder how other developers test their code? RelyingParty and
OpenIDUser are both final and they are not behind interfaces.

Thanks for any hints,
Marc

David Yu

unread,
Dec 7, 2009, 9:59:09 AM12/7/09
to dyupr...@googlegroups.com
On Mon, Dec 7, 2009 at 7:15 PM, Marc <marc...@gmail.com> wrote:
I've been testing dyuproject and run into two issues:

1. Attribute exchange per request
If I understand RelyingParty correctly, attribute exchange can only be
configured on a global level with RelyingParty.addListener(). This is
very unfortunate for my use case as I basically only need attributes
with the first login of a new user. Is there a way to configure
attributes on a per request basis?

Definitely ... you can filter it based on the request. 
Simply supply your own listener that wraps the extension ... and
delegate to that extension based on the state of your application.

2. Unit testing
I wonder how other developers test their code? RelyingParty and
OpenIDUser are both final and they are not behind interfaces.

They are pretty mockable actually ... a developer (Dominique Derrien) was able to test it with mock objects.
See http://code.google.com/p/dyuproject/issues/detail?id=16

Hope that helps.

Thanks for any hints,
Marc

--

You received this message because you are subscribed to the Google Groups "dyuproject" group.
To post to this group, send email to dyupr...@googlegroups.com.
To unsubscribe from this group, send email to dyuproject+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dyuproject?hl=en.





--
When the cat is away, the mouse is alone.
- David Yu

Marc Speck

unread,
Dec 9, 2009, 7:19:45 AM12/9/09
to dyupr...@googlegroups.com
Thanks for the feedback.

On Mon, Dec 7, 2009 at 3:59 PM, David Yu <david....@gmail.com> wrote:


On Mon, Dec 7, 2009 at 7:15 PM, Marc <marc...@gmail.com> wrote:
I've been testing dyuproject and run into two issues:

1. Attribute exchange per request
If I understand RelyingParty correctly, attribute exchange can only be
configured on a global level with RelyingParty.addListener(). This is
very unfortunate for my use case as I basically only need attributes
with the first login of a new user. Is there a way to configure
attributes on a per request basis?

Definitely ... you can filter it based on the request. 
Simply supply your own listener that wraps the extension ... and
delegate to that extension based on the state of your application.
 
Oh, I was looking at the wrong place: I hunted around RelyingParty.authenticate(). Customizing the listener works fine though I preferred a way in authenticate().

 

2. Unit testing
I wonder how other developers test their code? RelyingParty and
OpenIDUser are both final and they are not behind interfaces.

They are pretty mockable actually ... a developer (Dominique Derrien) was able to test it with mock objects.
See http://code.google.com/p/dyuproject/issues/detail?id=16

Yeah, I've just learned that EasyMock allows to mock final classes. I use Mockito which cannot mock final classes :(
So if it matters, my vote is on interfaces...

Thanks anyway,
Marc


Reply all
Reply to author
Forward
0 new messages