Bases: object
Hacked up code from boto/connection.py
Generate auth string according to what SignatureVersion is given.
Bases: object
Reader to limit the size of an incoming request.
Bases: json.encoder.JSONEncoder
Help for JSON encoding dict-like objects.
Constant-time string comparison.
Params provided: | |
---|---|
the first string | |
Params known: | the second string |
Returns: | True if the strings are equal. |
This function takes two strings and compares them. It is intended to be used when doing a comparison for authentication purposes to help guard against timing attacks. When using the function for this purpose, always provide the user-provided password as the first argument. The time this function will take is always a factor of the length of this string.
Run command with arguments and return its output as a byte string.
If the exit code was non-zero it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute and output in the output attribute.
The arguments are the same as for the Popen constructor. Example:
>>> check_output(['ls', '-l', '/dev/null'])
'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'
The stdout argument is not allowed as it is used internally. To capture standard error in the result, use stderr=STDOUT.
>>> check_output(['/bin/sh', '-c',
... 'ls -l non_existent_file ; exit 0'],
... stderr=STDOUT)
'ls: non_existent_file: No such file or directory\n'
Check that a plaintext password matches hashed.
hashpw returns the salt value concatenated with the actual hash value. It extracts the actual salt if this value is then passed as the salt.
Hash a user dict’s password without modifying the passed-in dict
Hash a password. Hard.
Hash a user dict’s password without modifying the passed-in dict
Hash a password. Hard.
Read from a file if it has been modified.
Parameters: |
|
---|---|
Returns: | data from file. |
Truncate passwords to the MAX_PASSWORD_LENGTH.
Format datetime object as unix timestamp
Parameters: | dt_obj – datetime.datetime object |
---|---|
Returns: | float |