Skip Menu |

This queue is for tickets about the Net-OAuth2 CPAN distribution.

Report information
The Basics
Id: 82967
Status: resolved
Priority: 0/
Queue: Net-OAuth2

People
Owner: Nobody in particular
Requestors: SKAUFMAN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.52
Fixed in: (no value)



Subject: Net::OAuth2::Profile::WebServer::update_access_token is busted
patch below, params from response returns a hash (or array), not a hashref. diff -r Net-OAuth2-0.52/lib/Net/OAuth2/Profile/WebServer.pm Net-OAuth2-0.52-dev/lib/Net/OAuth2/Profile/WebServer.pm 114c114 < my $data = $self->params_from_response($resp, 'update token'); --- Show quoted text
> my %data = $self->params_from_response($resp, 'update token');
116c116 < my $token = $data->{access_token} --- Show quoted text
> my $token = $data{access_token}
119c119 < my $type = $data->{token_type}; --- Show quoted text
> my $type = $data{token_type};
121c121 < my $exp = $data->{expires_in} --- Show quoted text
> my $exp = $data{expires_in}
Subject: Re: [rt.cpan.org #82967] Net::OAuth2::Profile::WebServer::update_access_token is busted
Date: Sat, 26 Jan 2013 22:04:40 +0100
To: Samuel Kaufman via RT <bug-Net-OAuth2 [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Samuel Kaufman via RT (bug-Net-OAuth2@rt.cpan.org) [130126 04:59]: Show quoted text
> Fri Jan 25 23:59:38 2013: Request 82967 was acted upon. > Transaction: Ticket created by SKAUFMAN > Queue: Net-OAuth2 > Subject: Net::OAuth2::Profile::WebServer::update_access_token is busted > Requestors: SKAUFMAN@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=82967 > > > params from response returns a hash (or array), not a hashref.
My question: does the update procedure work with this patch? I have not yet tested it at all ;-) Thanks for your patch. I'll probably produce a new release (0.53) later this evening. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
CC: SKAUFMAN [...] cpan.org
Subject: Re: [rt.cpan.org #82967] Net::OAuth2::Profile::WebServer::update_access_token is busted
Date: Sat, 26 Jan 2013 16:14:33 -0500
To: bug-Net-OAuth2 [...] rt.cpan.org
From: Samuel Kaufman <samuel.c.kaufman [...] gmail.com>
Yep, it does :) I'm using it here: https://github.com/ediblenergy/pdd/blob/master/script/greader.pl Another issue I see is that Net::OAuth2::AccessToken has 'refresh_token' which is a token and also a boolean. The docs say it's a boolean, but it's used to store the actual refresh_token, and if it's present it will always call refresh when you call ->access_token. I commented it out: # elsif($self->refresh_token) # { # refresh token at each use # $self->refresh; # } but I think what would work would be an additional boolean auto_refresh_on_expire or something, and have auto_refresh just call $self->refresh each time ->access_token is called. On Sat, Jan 26, 2013 at 4:04 PM, Mark Overmeer via RT <bug-Net-OAuth2@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=82967 > > > * Samuel Kaufman via RT (bug-Net-OAuth2@rt.cpan.org) [130126 04:59]:
>> Fri Jan 25 23:59:38 2013: Request 82967 was acted upon. >> Transaction: Ticket created by SKAUFMAN >> Queue: Net-OAuth2 >> Subject: Net::OAuth2::Profile::WebServer::update_access_token is busted >> Requestors: SKAUFMAN@cpan.org >> Status: new >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=82967 > >> >> params from response returns a hash (or array), not a hashref.
> > My question: does the update procedure work with this patch? I have not > yet tested it at all ;-) > > Thanks for your patch. I'll probably produce a new release (0.53) later > this evening. > -- > Regards, > MarkOv > > ------------------------------------------------------------------------ > Mark Overmeer MSc MARKOV Solutions > Mark@Overmeer.net solutions@overmeer.net > http://Mark.Overmeer.net http://solutions.overmeer.net > >
Subject: Re: [rt.cpan.org #82967] Net::OAuth2::Profile::WebServer::update_access_token is busted
Date: Sat, 26 Jan 2013 22:26:11 +0100
To: Samuel Kaufman via RT <bug-Net-OAuth2 [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Samuel Kaufman via RT (bug-Net-OAuth2@rt.cpan.org) [130126 21:14]: Show quoted text
> Queue: Net-OAuth2 > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=82967 > > > Another issue I see is that Net::OAuth2::AccessToken has > 'refresh_token'
I recently took over this module, and tried to document it and keep backwards compatibility with some doubtful design decissions in the past. I need to compare the current code with release 0.07 to understand what was actually ment. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #82967] Net::OAuth2::Profile::WebServer::update_access_token is busted
Date: Sun, 27 Jan 2013 01:54:46 +0100
To: Samuel Kaufman via RT <bug-Net-OAuth2 [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Samuel Kaufman via RT (bug-Net-OAuth2@rt.cpan.org) [130126 21:14]: Show quoted text
> Queue: Net-OAuth2 > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=82967 > > > Another issue I see is that Net::OAuth2::AccessToken has > 'refresh_token' which is a token and also a boolean.
The original code was probably never tested with refresh... I plan to break backwards compatibility by renaming the "refresh_token" boolean into "refresh_always". Can you show me a working piece of code which uses refresh_token? Is there more of that which I could automate in the module, to simplify the main script? -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
CC: SKAUFMAN [...] cpan.org
Subject: Re: [rt.cpan.org #82967] Net::OAuth2::Profile::WebServer::update_access_token is busted
Date: Sun, 27 Jan 2013 00:08:48 -0500
To: bug-Net-OAuth2 [...] rt.cpan.org
From: Samuel Kaufman <samuel.c.kaufman [...] gmail.com>
Sure, I wrote a test: https://github.com/ediblenergy/Net-OAuth2/blob/master/t/refresh_token.t Passes with the patch I sent over. I think the Module works pretty well, I can't think of anything I'd need in the module. On Sat, Jan 26, 2013 at 7:55 PM, Mark Overmeer via RT <bug-Net-OAuth2@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=82967 > > > * Samuel Kaufman via RT (bug-Net-OAuth2@rt.cpan.org) [130126 21:14]:
>> Queue: Net-OAuth2 >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=82967 > >> >> Another issue I see is that Net::OAuth2::AccessToken has >> 'refresh_token' which is a token and also a boolean.
> > The original code was probably never tested with refresh... > I plan to break backwards compatibility by renaming the "refresh_token" > boolean into "refresh_always". > > Can you show me a working piece of code which uses refresh_token? Is > there more of that which I could automate in the module, to simplify > the main script? > -- > Regards, > MarkOv > > ------------------------------------------------------------------------ > Mark Overmeer MSc MARKOV Solutions > Mark@Overmeer.net solutions@overmeer.net > http://Mark.Overmeer.net http://solutions.overmeer.net > >
Fixed a long time ago