The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

OAuthomatic::Types - few helper types to make code more readable and less error-prone

DESCRIPTION

Types below are defined to make code a bit more readable and less error prone.

OAuthomatic::Types::StructCleaner

Role composed into types defined below. Handles some construction conventions.

  • Any empty or undef'ed values are dropped as if they were not specified at all.

  • If args data and remap are given, constructor can translate field names, for example:

    Something->new(data=>{aaa=>'x', bbb=>'y'},
                   remap=>{aaa=>'token', 'bbb'=>'secret');

    is equivalent to:

    Something->new(token=>'x', secret=>'y');

    Partial replacements are possible too:

    Something->new(data=>{token=>'x', bbb=>'y'},
                   remap=>{'bbb'=>'secret');

OAuthomatic::Types::ClientCred

Client (application) credentials. Fixed key and secret allocated manually using server web interface (usually after filling some form with various details) which identify the application.

ATTRIBUTES

key

Client key - the application identifier.

secret

Client secret - confidential value used to sign requests, to prove key is valid.

OAuthomatic::Types::TemporaryCred

Temporary (request) credentials. Used during process of allocating token credentials.

ATTRIBUTES

token

Actual token - identifier quoted in requests.

secret

Associated secret - confidential value used to sign requests, to prove they are valid.

authorize_page

Full URL of the page end user should use to spend this temporary credential and generate access token. Already contains the token.

OAuthomatic::Types::TokenCred

Token (access) credentials. Those are used to sign actual API calls.

OAuthomatic::Types::Verifier

Verifier info, returned from authorization.