Documentation

OAuthStorageAbstract
in package
implements OAuthStorageInterface

AbstractYes

Implements an abstract OAuth storage adapter

Table of Contents

Interfaces

OAuthStorageInterface
Specifies the methods required for an OAuth storage adapter

Constants

ENCRYPT_FORMAT  = \chillerlan\Utilities\Crypto::ENCRYPT_FORMAT_HEX
Output format for encrypted data
KEY_STATE  = 'STATE'
KEY_TOKEN  = 'TOKEN'
KEY_VERIFIER  = 'VERIFIER'

Properties

$logger  : LoggerInterface
A PSR-3 logger
$options  : OAuthOptions|SettingsContainerInterface
The options instance

Methods

__construct()  : mixed
OAuthStorageAbstract constructor.
fromStorage()  : AccessToken
Retrieves token JOSN from the underlying storage engine and returns an AccessToken
setLogger()  : static
Sets a logger. (LoggerAwareInterface is stupid)
toStorage()  : mixed
Prepares an AccessToken for storage (serialize, encrypt etc.) and returns a value that is suited for the underlying storage engine
decrypt()  : string
decrypts the given $encrypted data
encrypt()  : string
encrypts the given $data
getProviderName()  : string
Gets the current provider name

Constants

ENCRYPT_FORMAT

Output format for encrypted data

protected int ENCRYPT_FORMAT = \chillerlan\Utilities\Crypto::ENCRYPT_FORMAT_HEX

Properties

Methods

__construct()

OAuthStorageAbstract constructor.

public __construct([OAuthOptions|SettingsContainerInterface $options = new OAuthOptions() ][, LoggerInterface $logger = new NullLogger() ]) : mixed
Parameters
$options : OAuthOptions|SettingsContainerInterface = new OAuthOptions()
$logger : LoggerInterface = new NullLogger()

setLogger()

Sets a logger. (LoggerAwareInterface is stupid)

public setLogger(LoggerInterface $logger) : static
Parameters
$logger : LoggerInterface
Tags
codeCoverageIgnore
Return values
static

toStorage()

Prepares an AccessToken for storage (serialize, encrypt etc.) and returns a value that is suited for the underlying storage engine

public toStorage(AccessToken $token) : mixed
Parameters
$token : AccessToken

decrypt()

decrypts the given $encrypted data

protected decrypt(string $encrypted) : string
Parameters
$encrypted : string
Return values
string

encrypt()

encrypts the given $data

protected encrypt(string $data) : string
Parameters
$data : string
Return values
string

        
On this page

Search results