Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct ($config) | |
generateNonce (RequestInterface $request) | |
getParamsToSign (RequestInterface $request, $timestamp, $nonce) | |
getSignature (RequestInterface $request, $timestamp, $nonce) | |
getStringToSign (RequestInterface $request, $timestamp, $nonce) | |
getTimestamp (Event $event) | |
onRequestBeforeSend (Event $event) | |
shouldPostFieldsBeSigned ($request) | |
Static Public Member Functions | |
static | getSubscribedEvents () |
Data Fields | |
const | REQUEST_METHOD_HEADER = 'header' |
const | REQUEST_METHOD_QUERY = 'query' |
Protected Member Functions | |
getOauthParams ($timestamp, $nonce) | |
prepareParameters ($data) | |
Protected Attributes | |
$config | |
OAuth signing plugin http://oauth.net/core/1.0/#rfc.section.9.1.1
Definition at line 17 of file OauthPlugin.php.
Guzzle\Plugin\Oauth\OauthPlugin::__construct | ( | $config | ) |
Create a new OAuth 1.0 plugin
array | $config | Configuration array containing these parameters:
|
Definition at line 47 of file OauthPlugin.php.
References Guzzle\Plugin\Oauth\OauthPlugin\$config, and Guzzle\Common\Collection\fromConfig().
Guzzle\Plugin\Oauth\OauthPlugin::generateNonce | ( | RequestInterface | $request | ) |
Returns a Nonce Based on the unique id and URL. This will allow for multiple requests in parallel with the same exact timestamp to use separate nonce's.
RequestInterface | $request | Request to generate a nonce for |
Definition at line 266 of file OauthPlugin.php.
References Guzzle\Http\Message\RequestInterface\getUrl().
Referenced by Guzzle\Plugin\Oauth\OauthPlugin\onRequestBeforeSend().
|
protected |
Get the oauth parameters as named by the oauth spec
$timestamp | |
$nonce |
Definition at line 178 of file OauthPlugin.php.
Referenced by Guzzle\Plugin\Oauth\OauthPlugin\getParamsToSign(), and Guzzle\Plugin\Oauth\OauthPlugin\onRequestBeforeSend().
Guzzle\Plugin\Oauth\OauthPlugin::getParamsToSign | ( | RequestInterface | $request, |
$timestamp, | |||
$nonce | |||
) |
Get all of the parameters required to sign a request including:
RequestInterface | $request | Request to generate a signature for |
integer | $timestamp | Timestamp to use for nonce |
string | $nonce |
Definition at line 217 of file OauthPlugin.php.
References Guzzle\Plugin\Oauth\OauthPlugin\getOauthParams(), Guzzle\Http\Message\RequestInterface\getQuery(), and Guzzle\Plugin\Oauth\OauthPlugin\shouldPostFieldsBeSigned().
Referenced by Guzzle\Plugin\Oauth\OauthPlugin\getStringToSign().
Guzzle\Plugin\Oauth\OauthPlugin::getSignature | ( | RequestInterface | $request, |
$timestamp, | |||
$nonce | |||
) |
Calculate signature for request
RequestInterface | $request | Request to generate a signature for |
integer | $timestamp | Timestamp to use for nonce |
string | $nonce |
Definition at line 136 of file OauthPlugin.php.
References Guzzle\Plugin\Oauth\OauthPlugin\getStringToSign().
Referenced by Guzzle\Plugin\Oauth\OauthPlugin\onRequestBeforeSend().
Guzzle\Plugin\Oauth\OauthPlugin::getStringToSign | ( | RequestInterface | $request, |
$timestamp, | |||
$nonce | |||
) |
Calculate string to sign
RequestInterface | $request | Request to generate a signature for |
int | $timestamp | Timestamp to use for nonce |
string | $nonce |
Definition at line 153 of file OauthPlugin.php.
References Guzzle\Http\Url\factory(), Guzzle\Http\Message\RequestInterface\getMethod(), Guzzle\Plugin\Oauth\OauthPlugin\getParamsToSign(), Guzzle\Http\Message\RequestInterface\getQuery(), Guzzle\Http\Message\RequestInterface\getUrl(), and Guzzle\Plugin\Oauth\OauthPlugin\prepareParameters().
Referenced by Guzzle\Plugin\Oauth\OauthPlugin\getSignature().
|
static |
Returns an array of event names this subscriber wants to listen to.
The array keys are event names and the value can be:
For instance:
Implements Symfony\Component\EventDispatcher\EventSubscriberInterface.
Definition at line 64 of file OauthPlugin.php.
Referenced by Guzzle\Tests\Plugin\Oauth\OauthPluginTest\testSubscribesToEvents().
Guzzle\Plugin\Oauth\OauthPlugin::getTimestamp | ( | Event | $event | ) |
Gets timestamp from event or create new timestamp
Event | $event | Event containing contextual information |
Definition at line 278 of file OauthPlugin.php.
Referenced by Guzzle\Plugin\Oauth\OauthPlugin\onRequestBeforeSend().
Guzzle\Plugin\Oauth\OauthPlugin::onRequestBeforeSend | ( | Event | $event | ) |
Request before-send event handler
Event | $event | Event received |
Definition at line 78 of file OauthPlugin.php.
References Guzzle\Plugin\Oauth\OauthPlugin\generateNonce(), Guzzle\Plugin\Oauth\OauthPlugin\getOauthParams(), Guzzle\Plugin\Oauth\OauthPlugin\getSignature(), Guzzle\Plugin\Oauth\OauthPlugin\getTimestamp(), Guzzle\Plugin\Oauth\OauthPlugin\REQUEST_METHOD_HEADER, and Guzzle\Plugin\Oauth\OauthPlugin\REQUEST_METHOD_QUERY.
|
protected |
Convert booleans to strings, removed unset parameters, and sorts the array
array | $data | Data array |
Definition at line 290 of file OauthPlugin.php.
Referenced by Guzzle\Plugin\Oauth\OauthPlugin\getStringToSign().
Guzzle\Plugin\Oauth\OauthPlugin::shouldPostFieldsBeSigned | ( | $request | ) |
Decide whether the post fields should be added to the base string that Oauth signs. This implementation is correct. Non-conformant APIs may require that this method be overwritten e.g. the Flickr API incorrectly adds the post fields when the Content-Type is 'application/x-www-form-urlencoded'
$request |
Definition at line 246 of file OauthPlugin.php.
Referenced by Guzzle\Plugin\Oauth\OauthPlugin\getParamsToSign().
|
protected |
Configuration settings
Definition at line 29 of file OauthPlugin.php.
Referenced by Guzzle\Plugin\Oauth\OauthPlugin\__construct().
const Guzzle\Plugin\Oauth\OauthPlugin::REQUEST_METHOD_HEADER = 'header' |
Consumer request method constants. See http://oauth.net/core/1.0/#consumer_req_param
Definition at line 22 of file OauthPlugin.php.
Referenced by Guzzle\Plugin\Oauth\OauthPlugin\onRequestBeforeSend().
const Guzzle\Plugin\Oauth\OauthPlugin::REQUEST_METHOD_QUERY = 'query' |
Definition at line 23 of file OauthPlugin.php.
Referenced by Guzzle\Plugin\Oauth\OauthPlugin\onRequestBeforeSend(), and Guzzle\Tests\Plugin\Oauth\OauthPluginTest\testSignsOauthQueryStringRequest().