Skip to content

Commit

Permalink
change disgest to password
Browse files Browse the repository at this point in the history
  • Loading branch information
snopoke committed Sep 4, 2018
1 parent 5c7c60e commit fce79de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion commcare_export/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def add_to_parser(self, parser, **additional_kwargs):
Argument('project'),
Argument('username'),
Argument('password', help='Enter password, or if using apikey auth-mode, enter the api key.'),
Argument('auth-mode', default='digest', choices=['digest', 'apikey'],
Argument('auth-mode', default='password', choices=['password', 'apikey'],
help='Use "digest" auth, or "apikey" auth (for two factor enabled domains).'),
Argument('since', help='Export all data after this date. Format YYYY-MM-DD or YYYY-MM-DDTHH:mm:SS'),
Argument('until', help='Export all data up until this date. Format YYYY-MM-DD or YYYY-MM-DDTHH:mm:SS'),
Expand Down
6 changes: 3 additions & 3 deletions commcare_export/commcare_hq_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from requests.auth import AuthBase
from requests.auth import HTTPDigestAuth

AUTH_MODE_DIGEST = 'digest'
AUTH_MODE_PASSWORD = 'password'
AUTH_MODE_APIKEY = 'apikey'

try:
Expand Down Expand Up @@ -51,7 +51,7 @@ class CommCareHqClient(object):
"""

def __init__(self, url, project, username, password,
auth_mode=AUTH_MODE_DIGEST, version=LATEST_KNOWN_VERSION, checkpoint_manager=None):
auth_mode=AUTH_MODE_PASSWORD, version=LATEST_KNOWN_VERSION, checkpoint_manager=None):
self.version = version
self.url = url
self.project = project
Expand All @@ -60,7 +60,7 @@ def __init__(self, url, project, username, password,
self.__session = None

def _get_auth(self, username, password, mode):
if mode == AUTH_MODE_DIGEST:
if mode == AUTH_MODE_PASSWORD:
return HTTPDigestAuth(username, password)
elif mode == AUTH_MODE_APIKEY:
return ApiKeyAuth(username, password)
Expand Down

0 comments on commit fce79de

Please sign in to comment.