Fork me on GitHub

Class base.Authentication


Defined in: authentication.js.

Class Summary
Constructor Attributes Constructor Name and Description
 

Authentication class.

Field Summary
Field Attributes Field Name and Description
 

Connection object.

 

Port number.

 
ssl

Use SSL?

Method Summary
Method Attributes Method Name and Description
 
authUrl(name)

Return authorization url.

 
createRequest(options)

Create a new signed request object.

 

Create a new signed request object with JSON results from XML.

 

Test provider (AWS).

 

Test provider (Google Storage).

 
sign(method, path, headers)

Sign request headers and return new headers.

Class Detail
base.Authentication(options)

Authentication class.

Parameters:
{Object} options
Options object.
{string} options.account
Account name.
{string} options.secretKey
Secret key.
{string} options.ssl Optional, Default: false
Use SSL?
{string} options.authUrl Optional
Authentication URL.
{number} options.timeout Optional
HTTP timeout in seconds.
Field Detail
{base.Connection} connection

Connection object.


{number} port

Port number.


{boolean} ssl

Use SSL?

Method Detail
authUrl(name)

Return authorization url.

Parameters:
{string} name Optional
Name to prepend to URL.

createRequest(options)

Create a new signed request object.

Parameters:
{Object} options
Options object.
{string} options.method Optional
HTTP method (verb).
{string} options.path Optional
HTTP path.
{Object} options.headers Optional
HTTP headers.
{Function} options.resultsFn Optional
Successful results data transform.

createXmlRequest(options)

Create a new signed request object with JSON results from XML.

Parameters:
{Object} options
Options object.
{string} options.method Optional
HTTP method (verb).
{string} options.path Optional
HTTP path.
{Object} options.headers Optional
HTTP headers.
{Function} options.resultsFn Optional
Successful results data transform.

isAws()

Test provider (AWS).


isGoogle()

Test provider (Google Storage).


{Object} sign(method, path, headers)

Sign request headers and return new headers.

Parameters:
{string} method Optional
HTTP method (verb).
{string} path Optional
HTTP path.
{Object} headers Optional
HTTP headers.
Returns:
{Object} Signed headers.