Example #1
0
 def __init__(self,
              as_user=None,
              spn=None,
              gssflags=k.GSS_C_MUTUAL_FLAG | k.GSS_C_SEQUENCE_FLAG,
              sslverify=True,
              proxies=None):
     self.sslverify = sslverify
     self.proxies = proxies
     self.retried = 0
     self.context = None
     self.gssflags = gssflags
     self.spn = spn
     if as_user:
         self.gss_step = s4u2p.authGSSImpersonationStep
         self.gss_response = s4u2p.authGSSImpersonationResponse
         self.gss_clean = s4u2p.authGSSImpersonationClean
         self.gss_init = lambda *args: s4u2p.authGSSImpersonationInit(
             as_user, *args)
         self.GSSError = s4u2p.GSSError
     else:
         self.gss_step = k.authGSSClientStep
         self.gss_response = k.authGSSClientResponse
         self.gss_clean = k.authGSSClientClean
         self.gss_init = k.authGSSClientInit
         self.GSSError = k.GSSError
Example #2
0
 def __init__(self, *args, **kwargs):
     """
     authurl is a random URL on the server that is protected by NTLM.
     user is the Windows user, probably in the DOMAIN\username format.
     pw is the password for the user.
     """
     as_user=kwargs.setdefault("as_user", None)
     self.gssflags=kwargs.setdefault("gssflags", k.GSS_C_MUTUAL_FLAG|k.GSS_C_SEQUENCE_FLAG|k.GSS_C_DELEG_FLAG)
     self.spn = kwargs.setdefault("spn", None)
     del kwargs["as_user"]
     del kwargs["gssflags"]
     del kwargs["spn"]
     if as_user:
         self.gss_step = s4u2p.authGSSImpersonationStep
         self.gss_response = s4u2p.authGSSImpersonationResponse
         self.gss_clean = s4u2p.authGSSImpersonationClean
         self.gss_init = lambda *args: s4u2p.authGSSImpersonationInit(as_user, *args)
         self.GSSError = s4u2p.GSSError
     else:
         self.gss_step = k.authGSSClientStep
         self.gss_response = k.authGSSClientResponse
         self.gss_clean = k.authGSSClientClean
         self.gss_init = k.authGSSClientInit
         self.GSSError = k.GSSError
         
     super(KerberosConnectionPool, self).__init__(*args, **kwargs)
Example #3
0
    def __init__(self, *args, **kwargs):
        """
        authurl is a random URL on the server that is protected by NTLM.
        user is the Windows user, probably in the DOMAIN\username format.
        pw is the password for the user.
        """
        as_user = kwargs.setdefault("as_user", None)
        self.gssflags = kwargs.setdefault(
            "gssflags",
            k.GSS_C_MUTUAL_FLAG | k.GSS_C_SEQUENCE_FLAG | k.GSS_C_DELEG_FLAG)
        self.spn = kwargs.setdefault("spn", None)
        del kwargs["as_user"]
        del kwargs["gssflags"]
        del kwargs["spn"]
        if as_user:
            self.gss_step = s4u2p.authGSSImpersonationStep
            self.gss_response = s4u2p.authGSSImpersonationResponse
            self.gss_clean = s4u2p.authGSSImpersonationClean
            self.gss_init = lambda *args: s4u2p.authGSSImpersonationInit(
                as_user, *args)
            self.GSSError = s4u2p.GSSError
        else:
            self.gss_step = k.authGSSClientStep
            self.gss_response = k.authGSSClientResponse
            self.gss_clean = k.authGSSClientClean
            self.gss_init = k.authGSSClientInit
            self.GSSError = k.GSSError

        super(KerberosConnectionPool, self).__init__(*args, **kwargs)
Example #4
0
 def __init__(self, as_user=None, spn=None, gssflags=k.GSS_C_MUTUAL_FLAG|k.GSS_C_SEQUENCE_FLAG):
     self.retried = 0
     self.context = None
     self.gssflags=gssflags
     self.spn = spn
     if as_user:
         self.gss_step = s4u2p.authGSSImpersonationStep
         self.gss_response = s4u2p.authGSSImpersonationResponse
         self.gss_clean = s4u2p.authGSSImpersonationClean
         self.gss_init = lambda *args: s4u2p.authGSSImpersonationInit(as_user, *args)
         self.GSSError = s4u2p.GSSError
     else:
         self.gss_step = k.authGSSClientStep
         self.gss_response = k.authGSSClientResponse
         self.gss_clean = k.authGSSClientClean
         self.gss_init = k.authGSSClientInit
         self.GSSError = k.GSSError
Example #5
0
 def __init__(self, as_user, spn, gssflags):
     self.retried = 0
     self.context = None
     self.gssflags=gssflags
     self.spn = spn
     if as_user:
         self.gss_step = s4u2p.authGSSImpersonationStep
         self.gss_response = s4u2p.authGSSImpersonationResponse
         self.gss_clean = s4u2p.authGSSImpersonationClean
         self.gss_init = lambda *args: s4u2p.authGSSImpersonationInit(as_user, *args)
         self.GSSError = s4u2p.GSSError
     else:
         self.gss_step = k.authGSSClientStep
         self.gss_response = k.authGSSClientResponse
         self.gss_clean = k.authGSSClientClean
         self.gss_init = k.authGSSClientInit
         self.GSSError = k.GSSError