pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0086-Added-new-authentication-method.patch

403b09
From b620de7a08aa626290f166213bb8e1eac62a47be Mon Sep 17 00:00:00 2001
403b09
From: Tiboris <tibor.dudlak@gmail.com>
403b09
Date: Tue, 16 Aug 2016 14:13:29 +0200
403b09
Subject: [PATCH] Added new authentication method
403b09
403b09
Addressing ticket https://fedorahosted.org/freeipa/ticket/5764
403b09
403b09
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
403b09
---
403b09
 ipaserver/plugins/xmlserver.py |  6 +++++-
403b09
 ipaserver/rpcserver.py         | 17 +++++++++++++----
403b09
 2 files changed, 18 insertions(+), 5 deletions(-)
403b09
403b09
diff --git a/ipaserver/plugins/xmlserver.py b/ipaserver/plugins/xmlserver.py
403b09
index d8fe24e0cb407603e9898e934229c9373f3c8b62..08c7456ed6dbfcc59f532314894031fba584e20a 100644
403b09
--- a/ipaserver/plugins/xmlserver.py
403b09
+++ b/ipaserver/plugins/xmlserver.py
403b09
@@ -28,12 +28,16 @@ register = Registry()
403b09
 
403b09
 
403b09
 if api.env.context in ('server', 'lite'):
403b09
-    from ipaserver.rpcserver import wsgi_dispatch, xmlserver, jsonserver_kerb, jsonserver_session, login_kerberos, login_password, change_password, sync_token, xmlserver_session
403b09
+    from ipaserver.rpcserver import (
403b09
+        wsgi_dispatch, xmlserver, jsonserver_kerb, jsonserver_session,
403b09
+        login_kerberos, login_x509, login_password, change_password,
403b09
+        sync_token, xmlserver_session)
403b09
     register()(wsgi_dispatch)
403b09
     register()(xmlserver)
403b09
     register()(jsonserver_kerb)
403b09
     register()(jsonserver_session)
403b09
     register()(login_kerberos)
403b09
+    register()(login_x509)
403b09
     register()(login_password)
403b09
     register()(change_password)
403b09
     register()(sync_token)
403b09
diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py
403b09
index d036f3c27521f17709672b830d5aa58167c76b34..e48dc3498d6ed8feb6ea44a9a678a8b8c50e8d9b 100644
403b09
--- a/ipaserver/rpcserver.py
403b09
+++ b/ipaserver/rpcserver.py
403b09
@@ -857,16 +857,16 @@ class jsonserver_kerb(jsonserver, KerberosWSGIExecutioner):
403b09
     key = '/json'
403b09
 
403b09
 
403b09
-class login_kerberos(Backend, KerberosSession, HTTP_Status):
403b09
-    key = '/session/login_kerberos'
403b09
+class KerberosLogin(Backend, KerberosSession, HTTP_Status):
403b09
+    key = None
403b09
 
403b09
     def _on_finalize(self):
403b09
-        super(login_kerberos, self)._on_finalize()
403b09
+        super(KerberosLogin, self)._on_finalize()
403b09
         self.api.Backend.wsgi_dispatch.mount(self, self.key)
403b09
         self.kerb_session_on_finalize()
403b09
 
403b09
     def __call__(self, environ, start_response):
403b09
-        self.debug('WSGI login_kerberos.__call__:')
403b09
+        self.debug('WSGI KerberosLogin.__call__:')
403b09
 
403b09
         # Get the ccache created by mod_auth_gssapi
403b09
         user_ccache_name=environ.get('KRB5CCNAME')
403b09
@@ -876,6 +876,15 @@ class login_kerberos(Backend, KerberosSession, HTTP_Status):
403b09
 
403b09
         return self.finalize_kerberos_acquisition('login_kerberos', user_ccache_name, environ, start_response)
403b09
 
403b09
+
403b09
+class login_kerberos(KerberosLogin):
403b09
+    key = '/session/login_kerberos'
403b09
+
403b09
+
403b09
+class login_x509(KerberosLogin):
403b09
+    key = '/session/login_x509'
403b09
+
403b09
+
403b09
 class login_password(Backend, KerberosSession, HTTP_Status):
403b09
 
403b09
     content_type = 'text/plain'
403b09
-- 
403b09
2.7.4
403b09