30 from requests.auth
import AuthBase
35 """ RAPP Authentication Class
37 Implements the RAPP Authentication mechanism for Platform requests.
44 @param string svcname - The service/application name.
56 """! Append the application token to the HTTP application protocol header.
58 Modify the request object. Append token string to the Accept-Token
59 field of the request header.
61 r.headers[
'Accept-Token'] = self.
_token
66 """! Load the RAPP Platform authentication token.
68 Currently only one application token exists, giving access to all the
69 RAPP Platform services!!
76 """! Read and token string stored in a file.
78 @param filepath string - The token file path.
80 with open(filepath,
'r') as tokenF:
81 self._token = str(tokenF.read()).replace('\n',
'')
def __read_token_from_file
Read and token string stored in a file.
def __call__
Append the application token to the HTTP application protocol header.
def __load_token
Load the RAPP Platform authentication token.