Package mindmeister :: Module auth :: Class AuthToken
[hide private]
[frames] | no frames]

Class AuthToken

source code


This class represent authentication token, used to sign API calls.

Token can be created with API key and secret (provided by mindmeister or
application). See
http://www.mindmeister.com/developers/authentication
for more details.
Token can be stored as file for further use.

In order to use token it must be registered by the following action
sequence:
  1. token = AuthToken(api_key, secret)
  2. frob = getTokenBegin (token, method)
     MindMeister.com web page with confirmation dialog will be opened.
     User should confirm access to the application.
  4. getTokenEnd (token, frob)

Method can be:
  1. read
  2. write
  3. delete

Instance Methods [hide private]
 
__init__(self, key, secret)
Create new (unregistered) token.
source code
 
load(self)
Load token from file.
source code
 
store(self)
Store token to a file.
source code
 
getFrob(self)
Returns a new frob for authentication.
source code
 
getTokenBegin(self, perms)
Start token registration process.
source code
 
getTokenEnd(self, frob)
Finish token registration process.
source code
 
check(self)
Checks the token for a user.
source code
 
setProxy(self, proxy)
Sets proxy to be used with this token.
source code
Method Details [hide private]

__init__(self, key, secret)
(Constructor)

source code 

Create new (unregistered) token.

Arguments:
key -- API key
secret -- shared secret
Optional (keyword) Arguments:

load(self)

source code 

Load token from file. Returns true if token has been successfully loaded.

Arguments:
Optional (keyword) Arguments:

store(self)

source code 

Store token to a file.

Arguments:
Optional (keyword) Arguments:

getFrob(self)

source code 

Returns a new frob for authentication.

Arguments:
Optional (keyword) Arguments:

This function calls mm.auth.getFrob MindMeister API method
More documentation can be found by this URL:
http://www.mindmeister.com/developers/explore_method?method=mm.auth.getFrob

getTokenBegin(self, perms)

source code 

Start token registration process.

Arguments:
perms -- permissions (method)
Optional (keyword) Arguments:

getTokenEnd(self, frob)

source code 

Finish token registration process.

Arguments:
perms -- frob obtained from getTokenBegin call
Optional (keyword) Arguments:

check(self)

source code 

Checks the token for a user.

Arguments:
Optional (keyword) Arguments:

This function calls mm.auth.checkToken MindMeister API method
More documentation can be found by this URL:
http://www.mindmeister.com/developers/explore_method?method=mm.auth.checkToken

setProxy(self, proxy)

source code 

Sets proxy to be used with this token.

Arguments:
proxy -- proxy to be used.
Optional (keyword) Arguments:

Sets proxy to be used with this token. Use None to disable proxy usage.