Module Expr Str Import alias Import alias Assign NameStore Num ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return CompareEq Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Return BinOpMod Str TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore BoolOpOr AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Num attr Str attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Return CompareEq Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Return BinOpMod Str TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore BoolOpOr AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Num attr Str attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Return CompareEq Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list decorator_list
N/A N/A This module hosts available auth types for encoding and matching user keys.
For adding a new auth type, simply write a class that satisfies the following
conditions:

- For the class name, capitalize first letter only. This makes sure the user
  can specify an all-lowercase config option such as "plaintext" or "sha1".
  Swauth takes care of capitalizing the first letter before instantiating it.
- Write an encode(key) method that will take a single argument, the user's key,
  and returns the encoded string. For plaintext, this would be
  "plaintext:<key>"
- Write a match(key, creds) method that will take two arguments: the user's
  key, and the user's retrieved credentials. Return a boolean value that
  indicates whether the match is True or False.
 N/A hashlib N/A os N/A MAX_TOKEN_LENGTH 5000 Plaintext N/A object N/A N/A Provides a particular auth type for encoding format for encoding and
    matching user keys.

    This class must be all lowercase except for the first character, which
    must be capitalized. encode and match methods must be provided and are
    the only ones that will be used by swauth.
     encode N/A N/A self key N/A N/A N/A Encodes a user key into a particular format. The result of this method
        will be used by swauth for storing user credentials.

        :param key: User's secret key
        :returns: A string representing user credentials
         N/A N/A plaintext:%s key N/A match N/A N/A self key creds N/A N/A N/A Checks whether the user-provided key matches the user's credentials

        :param key: User-supplied key
        :param creds: User's stored credentials
        :returns: True if the supplied key is valid, False otherwise
         N/A N/A N/A N/A self encode key creds N/A N/A Sha1 N/A object N/A N/A Provides a particular auth type for encoding format for encoding and
    matching user keys.

    This class must be all lowercase except for the first character, which
    must be capitalized. encode and match methods must be provided and are
    the only ones that will be used by swauth.
     encode_w_salt N/A N/A self salt key N/A N/A N/A Encodes a user key with salt into a particular format. The result of
        this method will be used internally.

        :param salt: Salt for hashing
        :param key: User's secret key
        :returns: A string representing user credentials
         N/A enc_key N/A %s%s N/A salt key N/A enc_val N/A N/A N/A N/A hashlib sha1 enc_key hexdigest N/A N/A sha1:%s$%s N/A salt enc_val N/A encode N/A N/A self key N/A N/A N/A Encodes a user key into a particular format. The result of this method
        will be used by swauth for storing user credentials.

        If salt is not manually set in conf file, a random salt will be
        generated and used.

        :param key: User's secret key
        :returns: A string representing user credentials
         N/A salt N/A N/A self salt N/A N/A N/A N/A N/A N/A os urandom 32 encode base64 rstrip N/A N/A N/A self encode_w_salt salt key N/A match N/A N/A self key creds N/A N/A N/A Checks whether the user-provided key matches the user's credentials

        :param key: User-supplied key
        :param creds: User's stored credentials
        :returns: True if the supplied key is valid, False otherwise
         N/A N/A type rest N/A N/A creds split : N/A N/A salt enc N/A N/A rest split $ N/A N/A N/A N/A self encode_w_salt salt key creds N/A N/A Sha512 N/A object N/A N/A Provides a particular auth type for encoding format for encoding and
    matching user keys.

    This class must be all lowercase except for the first character, which
    must be capitalized. encode and match methods must be provided and are
    the only ones that will be used by swauth.
     encode_w_salt N/A N/A self salt key N/A N/A N/A Encodes a user key with salt into a particular format. The result of
        this method will be used internal.

        :param salt: Salt for hashing
        :param key: User's secret key
        :returns: A string representing user credentials
         N/A enc_key N/A %s%s N/A salt key N/A enc_val N/A N/A N/A N/A hashlib sha512 enc_key hexdigest N/A N/A sha512:%s$%s N/A salt enc_val N/A encode N/A N/A self key N/A N/A N/A Encodes a user key into a particular format. The result of this method
        will be used by swauth for storing user credentials.

        If salt is not manually set in conf file, a random salt will be
        generated and used.

        :param key: User's secret key
        :returns: A string representing user credentials
         N/A salt N/A N/A self salt N/A N/A N/A N/A N/A N/A os urandom 32 encode base64 rstrip N/A N/A N/A self encode_w_salt salt key N/A match N/A N/A self key creds N/A N/A N/A Checks whether the user-provided key matches the user's credentials

        :param key: User-supplied key
        :param creds: User's stored credentials
        :returns: True if the supplied key is valid, False otherwise
         N/A N/A type rest N/A N/A creds split : N/A N/A salt enc N/A N/A rest split $ N/A N/A N/A N/A self encode_w_salt salt key creds N/A N/A