Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Some bits missing/wrong in the docs for the dev version of C::P::Authentication

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


autarch at urth

Mar 4, 2007, 8:34 AM

Post #1 of 4 (217 views)
Permalink
Some bits missing/wrong in the docs for the dev version of C::P::Authentication

I was trying to figure out why the authen/session integration bits weren't
working and I realized there's a couple problems in the docs here.

First, AFAICT, there's no mention that beyond setting "use_session" to
true in your config, you have to indicate that your user class supports
sessions.

Second, the method documentation in C::P::A::Internals suggests that you
should provide a method named "supports_features" in your user class.
However, looking at the code, it seems like this method is expected to be
named "support".

Finally, those same internals docs mention a Store class method
"user_supports", which AFAICT is kind of redundant, and not really used
anyway.


-dave

/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/

_______________________________________________
List: Catalyst[at]lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


autarch at urth

Mar 5, 2007, 9:05 AM

Post #2 of 4 (180 views)
Permalink
Re: Some bits missing/wrong in the docs for the dev version of C::P::Authentication [In reply to]

On Sun, 4 Mar 2007, Dave Rolsky wrote:

> Second, the method documentation in C::P::A::Internals suggests that you
> should provide a method named "supports_features" in your user class.
> However, looking at the code, it seems like this method is expected to be
> named "support".

Doh, I meant "supports", not "support".


-dave

/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/

_______________________________________________
List: Catalyst[at]lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


jayk at ion0

Mar 6, 2007, 3:50 PM

Post #3 of 4 (178 views)
Permalink
Re: Some bits missing/wrong in the docs for the dev version of C::P::Authentication [In reply to]

Hi Dave,

Thanks for the feedback. You are definitely right about the
session / supports issue, I'll add some wording to make that clear.

Regarding supported_features, supports, and user_supports, you are
partially correct and it is definitely confusing. Let me try to shed
some light.

First, $user->supports and $storagebackend->user_supports are the
official interfaces for the application developer. $user->supports
is obviously the correct call to make if you have a user object to
work with. There are situations, such as when working within a
credential, store, or other internal auth module, however, when you
may not have a user yet. You may still want to know what features
the user will support. This is where the $store->user_supports comes
in - as it allows you to check what features the user class will have.

$user->supports is a class method - but it is possible that the same
store could return multiple different classes representing a user -
so having the storage module handle this is the only course that
really makes sense. In many cases $store->user_supports will just
call the user class supports method anyway - but there is no rule
that says this must be the case for every storage module.

Finally - supported_features. Catalyst::Plugin::Authentication::User
implements supports() - and calls supported_features to retrieve a
hashref of features supported by the user object, and then supports()
does the necessary work to compare this hashref to the features
passed to supports(); In other words, the base user class lets you
be lazy in your user class by simply implementing
supported_features. There is no rule that says you can't implement
'supports' yourself in your user class, though.

Does this all make sense to you?

Thanks again for the feedback. I know this is all a little confusing
and I will work on explaining this better in the docs.

JayK

On Mar 4, 2007, at 10:34 AM, Dave Rolsky wrote:

> I was trying to figure out why the authen/session integration bits
> weren't working and I realized there's a couple problems in the
> docs here.
>
> First, AFAICT, there's no mention that beyond setting "use_session"
> to true in your config, you have to indicate that your user class
> supports sessions.
>
> Second, the method documentation in C::P::A::Internals suggests
> that you should provide a method named "supports_features" in your
> user class. However, looking at the code, it seems like this method
> is expected to be named "support".
>
> Finally, those same internals docs mention a Store class method
> "user_supports", which AFAICT is kind of redundant, and not really
> used anyway.
>
>
> -dave
>
> /*===================================================
> VegGuide.Org www.BookIRead.com
> Your guide to all that's veg. My book blog
> ===================================================*/
>
> _______________________________________________
> List: Catalyst[at]lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/
> catalyst[at]lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/

---
America will never be destroyed from the outside. If we falter and
lose our freedoms, it will be because we destroyed ourselves. --
Abraham Lincoln



_______________________________________________
List: Catalyst[at]lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


autarch at urth

Mar 7, 2007, 8:08 AM

Post #4 of 4 (177 views)
Permalink
Re: Some bits missing/wrong in the docs for the dev version of C::P::Authentication [In reply to]

On Tue, 6 Mar 2007, Jay K wrote:

> Does this all make sense to you?

I think so.

I think what would be really good would be to add a separate how-to
document that shows how to write your own minimal plugin, how to enable
the session integration, etc. This should be pretty high-level, and refer
the reader to Internals for detailed discussion on all the methods.

As it stands, trying to write a simple plugin requires me to read the
rather intimindating Internals docs, which contain way more info than I
need, organized in a way not well-suited to my goal.


-dave

/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/

_______________________________________________
List: Catalyst[at]lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.