diff --git a/pepper/cli.py b/pepper/cli.py index 1446333..68901d9 100644 --- a/pepper/cli.py +++ b/pepper/cli.py @@ -411,7 +411,9 @@ def get_login_details(self): else: if self.options.username is not None: results['SALTAPI_USER'] = self.options.username - if self.options.password is None and results['SALTAPI_PASS'] is None: + if self.options.password is None and \ + results['SALTAPI_PASS'] is None and \ + results['SALTAPI_EAUTH'] != 'kerberos': if self.options.interactive: results['SALTAPI_PASS'] = getpass.getpass(prompt='Password: ') else: diff --git a/pepper/libpepper.py b/pepper/libpepper.py index c5cecf6..c9ab461 100644 --- a/pepper/libpepper.py +++ b/pepper/libpepper.py @@ -267,8 +267,8 @@ def req_requests(self, path, data=None): ''' import requests - from requests_kerberos import HTTPKerberosAuth, OPTIONAL - auth = HTTPKerberosAuth(mutual_authentication=OPTIONAL) + from requests_gssapi import HTTPSPNEGOAuth, OPTIONAL + auth = HTTPSPNEGOAuth(mutual_authentication=OPTIONAL) headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', diff --git a/setup.py b/setup.py index c013a12..c6d645b 100644 --- a/setup.py +++ b/setup.py @@ -38,6 +38,9 @@ 'packages': [ 'pepper', ], + 'extras_require': { + 'kerberos': ["requests-gssapi>=1.1.0"], + }, 'scripts': [ 'scripts/pepper', ] diff --git a/tests/conftest.py b/tests/conftest.py index 02b9777..81d2662 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -89,7 +89,6 @@ def pepperconfig(salt_api_port): SALTAPI_EAUTH=sharedsecret [noopts] SALTAPI_URL=http://localhost:{0}/ - SALTAPI_EAUTH=kerberos '''.format(salt_api_port)) with open('tests/.pepperrc', 'w') as pepper_file: print(config, file=pepper_file)