mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-03 02:37:48 +08:00
Merge #1563 use gssapi if correct python-requests-kerberos is available
This commit is contained in:
@@ -496,17 +496,17 @@ class KojiModuleBuilder(GenericBuilder):
|
||||
if authtype == "kerberos":
|
||||
try:
|
||||
import krbV
|
||||
# We want to create a context per thread to avoid Kerberos cache corruption
|
||||
ctx = krbV.Context()
|
||||
except ImportError:
|
||||
raise RuntimeError(
|
||||
"python-krbV must be installed to authenticate with Koji using Kerberos")
|
||||
# If no krbV, we can assume GSSAPI auth is available
|
||||
ctx = None
|
||||
keytab = getattr(config, "krb_keytab", None)
|
||||
principal = getattr(config, "krb_principal", None)
|
||||
if not keytab and principal:
|
||||
raise ValueError(
|
||||
"The Kerberos keytab and principal aren't set for Koji authentication")
|
||||
log.debug(" keytab: %r, principal: %r" % (keytab, principal))
|
||||
# We want to create a context per thread to avoid Kerberos cache corruption
|
||||
ctx = krbV.Context()
|
||||
# We want to use the thread keyring for the ccache to ensure we have one cache per
|
||||
# thread to avoid Kerberos cache corruption
|
||||
ccache = "KEYRING:thread:mbs"
|
||||
|
||||
Reference in New Issue
Block a user