NAME
OAuthomatic::SecretStorage - Save and restore confidential OAuth tokens
VERSION
version 0.0201
DESCRIPTION
Interface defining methods used to save and restore various credentials. Implementations should use some kind of reasonably secure persistent storage, to preserve data over reruns.
Note: methods below are parameterless (except saved tokens), but should operate on access to specific remote site. Typical implementation would have required parameers like site_name
and password_group
in the constructor.
See OAuthomatic::SecretStorage::Keyring for default implementation (and example).
METHODS
get_client_cred() => ClientCred(...)
Return saved client tokens (client_key, client_secret), or undef if those were not (yet) saved. Returns OAuthomatic::Types::ClientCred.
save_client_cred(client_cred)
Save client tokens for future use.
Parameter is OAuthomatic::Types::ClientCred.
Never called if get_client_cred always returns some data. This method is used to save keys user provided after beint interactively asked.
clear_client_cred()
Clear client tokens, if any are saved.
Called in case restored tokens turn out invalid, expired, etc.
get_token_cred() => TokenCred(...)
Restore previously saved token and secret (access token, access secret), or undef if those were not (yet) saved. Returns OAuthomatic::Types::ClientCred.
save_token_cred(token_cred)
Saves token for future use, to be preserved over program restarts. Parameter is of type OAuthomatic::Types::ClientCred.
clear_token_cred()
Clear token, if it was saved. Called in case token is found to be wrong or expired.
AUTHOR
Marcin Kasperski <Marcin.Kasperski@mekk.waw.pl>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 by Marcin Kasperski.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.