auth
This module contains all the classes and methods necessary for authenticating with the API.
There’s no need to use any of these if using the Emtellipro class since that class uses this module internally.
Module Contents
Classes
Functions
Data
_headers_to_sign
API
emtellipro.auth.AuthenticationDetails
Bases: object
Conveniently stores the authentication details (access key, secret key) for use with all functions which require.
Initialization
Parameters:
- accesskey: the API key used to identify the user
- secretkey: the API key used to sign messages
AuthenticationDetails.accesskey
The access key stored in this object. Read-only.
AuthenticationDetails.secretkey
The secret key stored in this object. Read-only.
emtellipro.auth.APIKey
Bases: object
Container for the API key.
New in version 6.10.
Initialization
APIKey.apikey
The API key
emtellipro.auth.sign_request
Adds the necessary headers for authentication, in place, given the
authdetails this class was instantiated with.
Returns:
The same request that was passed in.
Return type: Request
emtellipro.auth.gen_auth_header
Generates the cmplete HMAC Authorization header which contains the necessary signature for the request, and the details needed to verify it.
Parameters:
The request to sign.
The holder for the authentication details.
Returns:
The ‘Authorization’ header value.
emtellipro.auth.string_to_sign
Given a Request object, this computes the string which the client needs to sign to verify the validity of the request.
Parameters:
The request to sign.
Returns:
The string that will need to be signed (this will contain the hash of the request).
emtellipro.auth.compute_canonical_request
Given a Request object, this computes the canonical request string which is then used for computing the signature of the request.
Parameters:
The request you want to sign.
Returns:
String representing the request in a consistent and deterministic format.

