conditional evaluation of proxyauthtype
This commit is contained in:
parent
24e5c0cb45
commit
ac8e83e3ac
1 changed files with 9 additions and 9 deletions
18
koji/auth.py
18
koji/auth.py
|
|
@ -374,15 +374,15 @@ class Session(object):
|
|||
else:
|
||||
raise koji.AuthError('%s is not authorized to login other users' % client_dn)
|
||||
|
||||
# in this point we can continue with proxied user in same way as if it is not proxied
|
||||
if proxyauthtype is not None:
|
||||
if not context.opts['ProxyAuthType']:
|
||||
raise koji.AuthError("Proxy must use same auth mechanism as hub "
|
||||
"(behaviour can be overriden via ProxyAuthType hub option)")
|
||||
if proxyauthtype not in (koji.AUTHTYPE_GSSAPI, koji.AUTHTYPE_SSL):
|
||||
raise koji.AuthError(
|
||||
"Proxied authtype %s is not valid for sslLogin" % proxyauthtype)
|
||||
authtype = proxyauthtype
|
||||
# in this point we can continue with proxied user in same way as if it is not proxied
|
||||
if proxyauthtype is not None:
|
||||
if not context.opts['ProxyAuthType']:
|
||||
raise koji.AuthError("Proxy must use same auth mechanism as hub (behaviour "
|
||||
"can be overriden via ProxyAuthType hub option)")
|
||||
if proxyauthtype not in (koji.AUTHTYPE_GSSAPI, koji.AUTHTYPE_SSL):
|
||||
raise koji.AuthError(
|
||||
"Proxied authtype %s is not valid for sslLogin" % proxyauthtype)
|
||||
authtype = proxyauthtype
|
||||
|
||||
if authtype == koji.AUTHTYPE_GSSAPI and '@' in username:
|
||||
user_id = self.getUserIdFromKerberos(username)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue