|
ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
HTTP AWS Authentication handler. More...
Inheritance diagram for Sabre\HTTP\Auth\AWS:
Collaboration diagram for Sabre\HTTP\Auth\AWS:Public Member Functions | |
| init () | |
| Gathers all information from the headers. More... | |
| getAccessKey () | |
| Returns the username for the request. More... | |
| validate ($secretKey) | |
| Validates the signature based on the secretKey. More... | |
| requireLogin () | |
| Returns an HTTP 401 header, forcing login. More... | |
Public Member Functions inherited from Sabre\HTTP\Auth\AbstractAuth | |
| __construct ($realm='SabreTooth', RequestInterface $request, ResponseInterface $response) | |
| Creates the object. More... | |
| requireLogin () | |
| This method sends the needed HTTP header and statuscode (401) to force the user to login. More... | |
| getRealm () | |
| Returns the HTTP realm. More... | |
Data Fields | |
| $errorCode = 0 | |
| const | ERR_NOAWSHEADER = 1 |
| const | ERR_MD5CHECKSUMWRONG = 2 |
| const | ERR_INVALIDDATEFORMAT = 3 |
| const | ERR_REQUESTTIMESKEWED = 4 |
| const | ERR_INVALIDSIGNATURE = 5 |
Protected Member Functions | |
| validateRFC2616Date ($dateHeader) | |
| Makes sure the supplied value is a valid RFC2616 date. More... | |
| getAmzHeaders () | |
| Returns a list of AMZ headers. More... | |
Private Member Functions | |
| hmacsha1 ($key, $message) | |
| Generates an HMAC-SHA1 signature. More... | |
Private Attributes | |
| $signature = null | |
| $accessKey = null | |
Additional Inherited Members | |
Protected Attributes inherited from Sabre\HTTP\Auth\AbstractAuth | |
| $realm | |
| $request | |
| $response | |
HTTP AWS Authentication handler.
Use this class to leverage amazon's AWS authentication header
| Sabre\HTTP\Auth\AWS::getAccessKey | ( | ) |
Returns the username for the request.
Definition at line 75 of file AWS.php.
References Sabre\HTTP\Auth\AWS\$accessKey.
|
protected |
Returns a list of AMZ headers.
Definition at line 189 of file AWS.php.
References $h.
Referenced by Sabre\HTTP\Auth\AWS\validate().
Here is the caller graph for this function:
|
private |
Generates an HMAC-SHA1 signature.
| string | $key | |
| string | $message |
Definition at line 216 of file AWS.php.
References $key, and $message.
Referenced by Sabre\HTTP\Auth\AWS\validate().
Here is the caller graph for this function:| Sabre\HTTP\Auth\AWS::init | ( | ) |
Gathers all information from the headers.
This method needs to be called prior to anything else.
Definition at line 54 of file AWS.php.
References Sabre\HTTP\Auth\AWS\ERR_NOAWSHEADER.
| Sabre\HTTP\Auth\AWS::requireLogin | ( | ) |
Returns an HTTP 401 header, forcing login.
This should be called when username and password are incorrect, or not supplied at all
Reimplemented from Sabre\HTTP\Auth\AbstractAuth.
Definition at line 142 of file AWS.php.
| Sabre\HTTP\Auth\AWS::validate | ( | $secretKey | ) |
Validates the signature based on the secretKey.
| string | $secretKey |
Definition at line 87 of file AWS.php.
References Sabre\HTTP\Auth\AWS\$signature, Sabre\HTTP\Auth\AWS\ERR_INVALIDSIGNATURE, Sabre\HTTP\Auth\AWS\ERR_MD5CHECKSUMWRONG, Sabre\HTTP\Auth\AWS\getAmzHeaders(), Sabre\HTTP\Auth\AWS\hmacsha1(), and Sabre\HTTP\Auth\AWS\validateRFC2616Date().
Here is the call graph for this function:
|
protected |
Makes sure the supplied value is a valid RFC2616 date.
If we would just use strtotime to get a valid timestamp, we have no way of checking if a user just supplied the word 'now' for the date header.
This function also makes sure the Date header is within 15 minutes of the operating system date, to prevent replay attacks.
| string | $dateHeader |
Definition at line 161 of file AWS.php.
References Sabre\HTTP\Auth\AWS\ERR_INVALIDDATEFORMAT, Sabre\HTTP\Auth\AWS\ERR_REQUESTTIMESKEWED, and Sabre\HTTP\Util\parseHTTPDate().
Referenced by Sabre\HTTP\Auth\AWS\validate().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 30 of file AWS.php.
Referenced by Sabre\HTTP\Auth\AWS\getAccessKey().
|
private |
Definition at line 23 of file AWS.php.
Referenced by Sabre\HTTP\Auth\AWS\validate().
| const Sabre\HTTP\Auth\AWS::ERR_INVALIDDATEFORMAT = 3 |
Definition at line 43 of file AWS.php.
Referenced by Sabre\HTTP\Auth\AWSTest\testNoDate(), and Sabre\HTTP\Auth\AWS\validateRFC2616Date().
| const Sabre\HTTP\Auth\AWS::ERR_INVALIDSIGNATURE = 5 |
Definition at line 45 of file AWS.php.
Referenced by Sabre\HTTP\Auth\AWSTest\testIncorrectSignature(), and Sabre\HTTP\Auth\AWS\validate().
| const Sabre\HTTP\Auth\AWS::ERR_MD5CHECKSUMWRONG = 2 |
Definition at line 42 of file AWS.php.
Referenced by Sabre\HTTP\Auth\AWSTest\testIncorrectContentMD5(), and Sabre\HTTP\Auth\AWS\validate().
| const Sabre\HTTP\Auth\AWS::ERR_NOAWSHEADER = 1 |
Definition at line 41 of file AWS.php.
Referenced by Sabre\HTTP\Auth\AWS\init(), and Sabre\HTTP\Auth\AWSTest\testNoHeader().
| const Sabre\HTTP\Auth\AWS::ERR_REQUESTTIMESKEWED = 4 |
Definition at line 44 of file AWS.php.
Referenced by Sabre\HTTP\Auth\AWSTest\testFutureDate(), Sabre\HTTP\Auth\AWSTest\testPastDate(), and Sabre\HTTP\Auth\AWS\validateRFC2616Date().