def __init__(self, ca_cert=None, oauth_key=None, oauth_secret=None): if not ca_cert: ca_cert = get_splice_server_identity_ca_pem() x509_auth = X509CertificateAuthentication(verification_ca=ca_cert) self.backends = [x509_auth] oauth_params = config.get_oauth_params() if oauth_params["enabled"]: if not oauth_key: oauth_key = oauth_params["key"] if not oauth_secret: oauth_secret = oauth_params["secret"] two_legged_oauth = TwoLeggedOAuthAuthentication(key=oauth_key, secret=oauth_secret) self.backends.append(two_legged_oauth)
def get_authentication(): return X509CertificateAuthentication(verification_ca=certs.get_splice_server_identity_ca_pem())