Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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