Compare commits
1 Commits
master
...
brutuscat/
Author | SHA1 | Date | |
---|---|---|---|
|
1249c00987 |
@ -1,15 +1,9 @@
|
||||
sudo: false
|
||||
|
||||
language: php
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7
|
||||
- hhvm
|
||||
|
||||
before_script:
|
||||
- composer selfupdate --quiet
|
||||
- composer install --prefer-dist
|
||||
- composer install --dev
|
||||
- vendor/phpunit/phpunit/composer/bin/phpunit
|
||||
|
@ -8,4 +8,3 @@ Andy Smith authored the original code (http://oauth.googlecode.com/svn/code/php/
|
||||
* Jacob Kiers (@jacobkiers)
|
||||
* Alexandru G. (@vimishor)
|
||||
* Victor Bjelkholm (@VictorBjelkholm)
|
||||
* David Macek (@elieux)
|
||||
|
@ -93,10 +93,17 @@ class Request implements RequestInterface
|
||||
public static function fromRequest($http_method = null, $http_url = null, $parameters = null)
|
||||
{
|
||||
$scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') ? 'http' : 'https';
|
||||
$scheme = isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
|
||||
? $_SERVER['HTTP_X_FORWARDED_PROTO']
|
||||
: $scheme;
|
||||
$port = isset($_SERVER['HTTP_X_FORWARDED_PORT'])
|
||||
? $_SERVER['HTTP_X_FORWARDED_PORT']
|
||||
: $_SERVER['SERVER_PORT'];
|
||||
|
||||
$http_url = ($http_url) ? $http_url : $scheme .
|
||||
'://' . $_SERVER['HTTP_HOST'] .
|
||||
':' .
|
||||
$_SERVER['SERVER_PORT'] .
|
||||
$port .
|
||||
$_SERVER['REQUEST_URI'];
|
||||
$http_method = ($http_method) ? $http_method : $_SERVER['REQUEST_METHOD'];
|
||||
|
||||
|
@ -243,7 +243,7 @@ class Server
|
||||
|
||||
$token = $this->data_store->lookupToken($consumer, $token_type, $token_key);
|
||||
if (!$token) {
|
||||
throw new OAuthException("Invalid $token_type token: $token_key");
|
||||
throw new OAuthException("Invalid $token_type token: $token_field");
|
||||
}
|
||||
return $token;
|
||||
}
|
||||
|
@ -27,6 +27,28 @@ use \JacobKiers\OAuth\Request\RequestInterface;
|
||||
*/
|
||||
abstract class SignatureMethod implements SignatureMethodInterface
|
||||
{
|
||||
/**
|
||||
* Return the name of the Signature Method (ie HMAC-SHA1).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getName();
|
||||
|
||||
/**
|
||||
* Build up the signature.
|
||||
*
|
||||
* NOTE: The output of this function MUST NOT be urlencoded.
|
||||
* the encoding is handled in OAuthRequest when the final
|
||||
* request is serialized.
|
||||
*
|
||||
* @param JacobKiers\OAuth\Request\RequestInterface $request
|
||||
* @param JacobKiers\OAuth\Consumer\ConsumerInterface $consumer
|
||||
* @param JacobKiers\OAuth\Token\TokenInterface $token
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function buildSignature(RequestInterface $request, ConsumerInterface $consumer, TokenInterface $token = null);
|
||||
|
||||
/**
|
||||
* Get the signature key, made up of consumer and optionally token shared secrets.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user