Hi all,

Been a while. I've been banging my head for ages and can't work out why changing the following makes prove fail

[http://cpansearch.perl.org/src/BOBTFISH/Catalyst-Plugin-Authenticatio +n-0.10018/lib/Catalyst/Authentication/Realm/Progressive.pm] if ( my $obj = $realm->authenticate( $c, $auth ) ) { $c->set_authenticated( $obj, $realm->name ); return $obj; } Changes: 139 my $auth_obj; 140 my $error = try { 141 $auth_obj = $realm->authenticate( $c, $auth ); 142 } 143 catch { return $_; }; 144 145 if ($auth_obj) { 146 $c->set_authenticated( $auth_obj, $realm->name ); 147 return $auth_obj; 148 }

[ghenry@dax-xen Catalyst-Plugin-Authentication]$ cat t/live_app_realms +_progressive.t use strict; use warnings; use Test::More; use lib 't/lib'; use Catalyst::Test qw/AuthRealmTestAppProgressive/; ok(get("/progressive"), "get ok"); done_testing; [ghenry@dax-xen Catalyst-Plugin-Authentication]$ cat t/lib/AuthRealmTe +stAppProgressive/Controller/Root.pm package AuthRealmTestAppProgressive::Controller::Root; use warnings; use strict; use base qw/Catalyst::Controller/; __PACKAGE__->config(namespace => ''); use Test::More; use Test::Exception; sub progressive : Local { my ( $self, $c ) = @_; foreach my $realm ( keys %AuthRealmTestAppProgressive::members ) { while ( my ( $user, $info ) = each %{$AuthRealmTestAppProgress +ive::members{$realm}} ) { my $ok = eval { $c->authenticate( { username => $user, password => $info->{password} + }, ); }; diag $@; diag $ok; ok( !$@, "authentication passed." ); ok( $ok, "user authenticated" ); ok( $c->user_in_realm($realm), "user in proper realm" ); } } $c->res->body( "ok" ); } 1; [ghenry@dax-xen Catalyst-Plugin-Authentication]$ prove -l t/live_app_r +ealms_progressive.t t/live_app_realms_progressive.t .. # # undef t/live_app_realms_progressive.t .. 1/? # Failed test 'user authenticated' # at t/lib/AuthRealmTestAppProgressive/Controller/Root.pm line 24. # Failed test 'user in proper realm' # at t/lib/AuthRealmTestAppProgressive/Controller/Root.pm line 25. # # undef # Failed test 'user authenticated' # at t/lib/AuthRealmTestAppProgressive/Controller/Root.pm line 24. # Looks like you failed 3 tests of 7. t/live_app_realms_progressive.t .. Dubious, test returned 3 (wstat 768 +, 0x300) Failed 3/7 subtests Test Summary Report ------------------- t/live_app_realms_progressive.t (Wstat: 768 Tests: 7 Failed: 3) Failed tests: 2-3, 5 Non-zero exit status: 3 Files=1, Tests=7, 7 wallclock secs ( 0.09 usr 0.00 sys + 4.14 cusr + 0.09 csys = 4.32 CPU) Result: FAIL

I'm trying to patch Catalyst::Authentication::Realm::Progressive to allow multiple realms with Basic HTTP auth, as the credential HTTP plugin calls ->detach which means other realms never get tried.
Thanks.

Walking the road to enlightenment... I found a penguin and a camel on the way.....
Fancy a yourname@perl.me.uk? Just ask!!!

In reply to Help with Try::Tiny and Catalyst::Authentication::Realm::Progressive by ghenry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.