OAuth:...mMethod(3pm)

πŸ“¦
version 0.11 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– OAuth::Lite2::ParamMethod πŸ’–

User Contributed Perl Documentation · the blueprint era of OAuth 2.0 param handling ✨


🌸 NAME 🌸

OAuth::Lite2::ParamMethod β€” bestie, it's the base class of builder/parser for OAuth 2.0 parameters. That's the whole vibe. Every other param method out here is lowkey just standing on this one's shoulders. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

Okay so here's how you actually use it, fr fr:

my $meth = OAuth::Lite2::ParamMethod::Foo->new;

# server side
if ($meth->match( $plack_request )) {
    my ($token, $params) = $meth->parse( $plack_request );
}

# client side
my $http_req = $meth->request_builder(...);

Two whole moods in one snippet: server side goes match β†’ parse, client side goes request_builder. Slay. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

It's the base class of builder/parser for OAuth 2.0 parameters. Not the main character itself, but the template every main character inherits from. ✨


πŸ’œ METHODS πŸ’œ

⭐ new

Constructor. That's it, that's the whole description. Make a new one, move on. 🫢

🌈 match( $plack_request )

Returns true if the Plack::Request object you passed in is matched for the type of this method. Vibe check, but for requests. 😌

if ( $meth->match( $plack_request ) ) {
    ...
}

πŸ“ parse( $plack_request )

Parse the Plack::Request, and returns access token and oauth parameters. Two things come back out, no cap. πŸ‘‘

my ($token, $params) = $meth->parse( $plack_request );

🧚 build_request( %params )

Build an HTTP::Request object. The full build, with all the keys it takes:

my $req = $meth->build_request(
    url          => $url,
    method       => $http_method,
    token        => $access_token,
    oauth_params => $oauth_params,
    params       => $params,
    content      => $content,
    headers      => $headers,
);

Seven keys, all named, all accounted for. Obsessed. ✨


πŸ”₯ SEE ALSO πŸ”₯

The whole little family, go read them too:

  • OAuth::Lite2::ParamMethods
  • OAuth::Lite2::ParamMethod::AuthHeader
  • OAuth::Lite2::ParamMethod::FormEncodedBody
  • OAuth::Lite2::ParamMethod::URIQueryParameter

πŸ‘‘ AUTHOR πŸ‘‘

Lyo Kato, <lyo.kato@gmail.com> πŸ’Œ


Copyright (C) 2010 by Lyo Kato

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

Legal bestie moment: free software, same terms as Perl itself, either Perl version 5.8.8 or (your choice!) any later version of Perl 5 you happen to have. Pick your fighter. πŸ’…

And that's the page, bestie β€” this doc dropped as part of perl v5.36.0, dated 2023-07-01, living in the User Contributed Perl Documentation. Go forth and parse some params. πŸ¦‹βœ¨

πŸ“¦ where this page comes from