techu.libraries.authentication

class techu.libraries.authentication.Auth(consumer_key='')

Authentication protocol Resembles OAuth process: * Client receives a Consumer Key/Secret pair * Constructs an authentication token with HMAC-SHA1 which is sent on each request. The Consumer Key and the Secret are comprised from ASCII uppercase & lowercase letters & digits This script can also be used as a command-line executable to generate key/secret pairs

Variables:
  • __token_salt – a salt for the generated secret
  • __consumer_key – the consumer_key sent on each request and is unique for each client (8 characters)
  • __secret – the secret from which a the request token is generated (16 characters)
generate()

Returns a consumer key & secret pair.

generate_secret()

Generate a random secret with a length of 16 characters.

get_secret()

Returns the secret for a consumer key.

randomize(length, elements=None)
Return a random string of specified length.
If elements parameter is None (default) ASCII uppercase, lowercase & digits are used as selection group.
update_secret()

Re-generate secret for a specific consumer key.

verify(token)

Test token using HMAC-SHA1.

Previous topic

techu.libraries.applier

Next topic

techu.libraries.caching

This Page