1from conf import rule
2
3""" Rule: Authentication
4This file defines an authentication rule which when applied to any file will
5cause the server to prompt the client for the required authentication details
6before serving it.
7auth_type must be either of: Basic, Digest, Both or Both-inline
8When auth_type is Basic or Digest, the server asks for the respective
9authentication in its response. When auth_type is Both, the server sends two
10Authenticate headers, one requesting Basic and the other requesting Digest
11authentication. If auth_type is Both-inline, the server sends only one
12Authenticate header, but lists both Basic and Digest as supported mechanisms in
13that.
14"""
15
16
17@rule()
18class Authentication:
19    def __init__ (self, auth_obj):
20        self.auth_type = auth_obj['Type']
21        self.auth_user = auth_obj['User']
22        self.auth_pass = auth_obj['Pass']
23