Authtype as enum and getSessionInfo prints authtype name

Fixes: https://pagure.io/koji/issue/3436
This commit is contained in:
Jana Cupova 2022-07-12 12:52:41 +02:00 committed by Tomas Kopecek
parent e5e59c1880
commit 44f5ebaabb
7 changed files with 42 additions and 35 deletions

View file

@ -7371,13 +7371,13 @@ def handle_moshimoshi(options, session, args):
print("")
print("You are using the hub at %s" % session.baseurl)
authtype = u.get('authtype', getattr(session, 'authtype', None))
if authtype == koji.AUTHTYPE_NORMAL:
if authtype == koji.AUTHTYPES['NORMAL']:
print("Authenticated via password")
elif authtype == koji.AUTHTYPE_GSSAPI:
elif authtype == koji.AUTHTYPES['GSSAPI']:
print("Authenticated via GSSAPI")
elif authtype == koji.AUTHTYPE_KERB:
elif authtype == koji.AUTHTYPES['KERBEROS']:
print("Authenticated via Kerberos principal %s" % session.krb_principal)
elif authtype == koji.AUTHTYPE_SSL:
elif authtype == koji.AUTHTYPES['SSL']:
print("Authenticated via client certificate %s" % options.cert)