Skip to content

Commit 8096e08

Browse files
authored
Merge pull request #199 from stockholmuniversity/replace_kerberos_with_spnego
Replace kerberos with spnego
2 parents 1890753 + 79604c5 commit 8096e08

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

pepper/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,9 @@ def get_login_details(self):
411411
else:
412412
if self.options.username is not None:
413413
results['SALTAPI_USER'] = self.options.username
414-
if self.options.password is None and results['SALTAPI_PASS'] is None:
414+
if self.options.password is None and \
415+
results['SALTAPI_PASS'] is None and \
416+
results['SALTAPI_EAUTH'] != 'kerberos':
415417
if self.options.interactive:
416418
results['SALTAPI_PASS'] = getpass.getpass(prompt='Password: ')
417419
else:

pepper/libpepper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ def req_requests(self, path, data=None):
267267
268268
'''
269269
import requests
270-
from requests_kerberos import HTTPKerberosAuth, OPTIONAL
271-
auth = HTTPKerberosAuth(mutual_authentication=OPTIONAL)
270+
from requests_gssapi import HTTPSPNEGOAuth, OPTIONAL
271+
auth = HTTPSPNEGOAuth(mutual_authentication=OPTIONAL)
272272
headers = {
273273
'Accept': 'application/json',
274274
'Content-Type': 'application/json',

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
'packages': [
3939
'pepper',
4040
],
41+
'extras_require': {
42+
'kerberos': ["requests-gssapi>=1.1.0"],
43+
},
4144
'scripts': [
4245
'scripts/pepper',
4346
]

tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ def pepperconfig(salt_api_port):
8989
SALTAPI_EAUTH=sharedsecret
9090
[noopts]
9191
SALTAPI_URL=http://localhost:{0}/
92-
SALTAPI_EAUTH=kerberos
9392
'''.format(salt_api_port))
9493
with open('tests/.pepperrc', 'w') as pepper_file:
9594
print(config, file=pepper_file)

0 commit comments

Comments
 (0)