Skip to content

Commit

Permalink
Merge pull request #199 from stockholmuniversity/replace_kerberos_wit…
Browse files Browse the repository at this point in the history
…h_spnego

Replace kerberos with spnego
  • Loading branch information
mattp- authored Feb 6, 2020
2 parents 1890753 + 79604c5 commit 8096e08
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pepper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pepper/libpepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
'packages': [
'pepper',
],
'extras_require': {
'kerberos': ["requests-gssapi>=1.1.0"],
},
'scripts': [
'scripts/pepper',
]
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8096e08

Please sign in to comment.