# Path: clam/common/digestauth.py
# def pwhash(user, realm, password):
#     #computes a password hash for a given user and plaintext password (HA1)
#     return md5(user.encode('utf-8') + b':' + realm.encode('utf-8') + b':' + password.encode('utf-8')).hexdigest()


from clam.common.parameters import *
from clam.common.formats import *
from clam.common.converters import *
from clam.common.viewers import *
from clam.common.data import *
from clam.common.digestauth import pwhash
import sys
#pre-installed corpora will be stored here. Set to an absolute path:
ROOT = "/tmp/clamactiontest.projects/"

#The URL of the system (If you start clam with the built-in webserver, you can override this with -P)
PORT= 8080

#The hostname of the system. Will be automatically determined if not set. (If you start clam with the built-in webserver, you can override this with -H)
#Users *must* make use of this hostname and no other (even if it points to the same IP) for the web application to work.
#HOST = 'localhost'

#If the webservice runs in another webserver (e.g. apache, nginx, lighttpd), and it
#doesn't run at the root of the server, you can specify a URL prefix here:
#URLPREFIX = "/myservice/"

#Optionally, you can force the full URL CLAM has to use, rather than rely on any autodetected measures:
#FORCEURL = "http://myclamservice.com"

#The location of where CLAM is installed (will be determined automatically if not set)
#CLAMDIR = "/path/to/clam"



# ======== AUTHENTICATION & SECURITY ===========

#Users and passwords

#set security realm, a required component for hashing passwords (will default to SYSTEM_ID if not set)
#REALM = SYSTEM_ID

#Users and passwords

# Path: clam/common/digestauth.py
# def pwhash(user, realm, password):
#     #computes a password hash for a given user and plaintext password (HA1)
#     return md5(user.encode('utf-8') + b':' + realm.encode('utf-8') + b':' + password.encode('utf-8')).hexdigest()


# Path: clam/config/authactiontest.py
from clam.common.parameters import *
from clam.common.formats import *
from clam.common.converters import *
from clam.common.viewers import *
from clam.common.data import *
from clam.common.digestauth import pwhash
import sys

#pre-installed corpora will be stored here. Set to an absolute path:
ROOT = "/tmp/clamactiontest.projects/"

#The URL of the system (If you start clam with the built-in webserver, you can override this with -P)
PORT= 8080

#The hostname of the system. Will be automatically determined if not set. (If you start clam with the built-in webserver, you can override this with -H)
#Users *must* make use of this hostname and no other (even if it points to the same IP) for the web application to work.
#HOST = 'localhost'

#If the webservice runs in another webserver (e.g. apache, nginx, lighttpd), and it
#doesn't run at the root of the server, you can specify a URL prefix here:
#URLPREFIX = "/myservice/"

#Optionally, you can force the full URL CLAM has to use, rather than rely on any autodetected measures:
#FORCEURL = "http://myclamservice.com"

#The location of where CLAM is installed (will be determined automatically if not set)
#CLAMDIR = "/path/to/clam"



# ======== AUTHENTICATION & SECURITY ===========

#Users and passwords

#set security realm, a required component for hashing passwords (will default to SYSTEM_ID if not set)
#REALM = SYSTEM_ID

#Users and passwords

USERS = {'proycon': pwhash('proycon',SYSTEM_ID,'secret'), 'antal': pwhash('antal',SYSTEM_ID,'secret')}