Net::G...:OAuth(3pm)

πŸ“¦
version 1.05 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Net::GitHub::V3::OAuth πŸ’–

okay bestie, gather round, because we're looking at Net::GitHub::V3::OAuth β€” the GitHub OAuth API module, straight out of the User Contributed Perl Documentation, and she is serving. πŸŽ€

✨ NAME ✨

Net::GitHub::V3::OAuth β€” it's the GitHub OAuth API, periodt. πŸ‘‘

🌸 SYNOPSIS 🌸

the vibe check, in code form:

use Net::GitHub::V3;

my $gh = Net::GitHub::V3->new; # read L<Net::GitHub::V3> to set right authentication info
my $oauth = $gh->oauth;

so you spin up a Net::GitHub::V3 object, and btw read Net::GitHub::V3 to set the right authentication info, don't skip that part. then $gh->oauth hands you your very own OAuth object. iconic. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea:

  • for the Web Application Flow, the suggestion is literally to use Net::OAuth. 🫢
  • for the Non-Web Application Flow, go read the Net::GitHub FAQ. no cap.

πŸ’… METHODS πŸ’…

πŸ‘‘ OAuth

the docs live here, bestie: <http://developer.github.com/v3/oauth/>

🌈 authorizations

my @authorizations = $oauth->authorizations();

boom, you get a whole list of authorizations back. slay.

πŸ“ authorization

my $authorization  = $oauth->authorization($authorization_id);

hand it an $authorization_id and it gives you back the one authorization. just the one. main character behavior. πŸ’œ

⭐ create_authorization

⭐ update_authorization

these two are besties so they're chilling together:

my $oauth = $oauth->create_authorization( {
    scopes => ['public_repo'],
    note   => 'admin script',
} );
my $oauth = $oauth->update_authorization( $authorization_id, $new_authorization_data );

create it with some scopes and a note, or update an existing one by passing the $authorization_id plus your $new_authorization_data. obsessed. πŸ”₯

🧚 delete

my $is_deleted = $oauth->delete_authorization($authorization_id);

give it the $authorization_id and it tells you whether it's deleted. bye bestie πŸ’€


just go Refer Net::GitHub. iykyk. πŸ’–


and that's the whole page, gorgeous β€” this was written against perl v5.36.0, dated 2022-10-08, and it's the Net::GitHub::V3::OAuth(3pm) manual page, so now you know exactly where it came from. mwah, go forth and OAuth responsibly. πŸŽ€πŸ’…βœ¨

πŸ“¦ where this page comes from