mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-04 18:46:17 +01:00
ssh auth: Avoid password prompt when using TransientCredentialsManager
This commit is contained in:
parent
24072286a0
commit
3d8efe2d15
@ -818,7 +818,10 @@ def get_config(override_conffile=None,
|
|||||||
'http_headers': http_headers}
|
'http_headers': http_headers}
|
||||||
api_host_options[apiurl] = APIHostOptionsEntry(entry)
|
api_host_options[apiurl] = APIHostOptionsEntry(entry)
|
||||||
|
|
||||||
optional = ('realname', 'email', 'sslcertck', 'cafile', 'capath', 'sshkey', 'allow_http')
|
optional = (
|
||||||
|
'realname', 'email', 'sslcertck', 'cafile', 'capath', 'sshkey', 'allow_http',
|
||||||
|
credentials.AbstractCredentialsManager.config_entry,
|
||||||
|
)
|
||||||
for key in optional:
|
for key in optional:
|
||||||
if cp.has_option(url, key):
|
if cp.has_option(url, key):
|
||||||
if key in ('sslcertck', 'allow_http'):
|
if key in ('sslcertck', 'allow_http'):
|
||||||
|
@ -508,6 +508,11 @@ class SignatureAuthHandler(AuthHandlerBase):
|
|||||||
def __init__(self, user, sshkey, basic_auth_password=None):
|
def __init__(self, user, sshkey, basic_auth_password=None):
|
||||||
self.user = user
|
self.user = user
|
||||||
self.sshkey = sshkey
|
self.sshkey = sshkey
|
||||||
|
|
||||||
|
apiurl = conf.config["apiurl"]
|
||||||
|
if conf.config["api_host_options"][apiurl].get("credentials_mgr_class", None) == "osc.credentials.TransientCredentialsManager":
|
||||||
|
self.basic_auth_password = False
|
||||||
|
else:
|
||||||
# value of `basic_auth_password` is only used as a hint if we should skip signature auth
|
# value of `basic_auth_password` is only used as a hint if we should skip signature auth
|
||||||
self.basic_auth_password = bool(basic_auth_password)
|
self.basic_auth_password = bool(basic_auth_password)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user