directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [1/2] directory-kerby git commit: Cache the tgs entry in identity backend.
Date Fri, 11 May 2018 04:45:14 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/has-project b5b9595f1 -> 7c9c9a67c


Cache the tgs entry in identity backend.


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/95440dc9
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/95440dc9
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/95440dc9

Branch: refs/heads/has-project
Commit: 95440dc97e8ececffa91111826a2c46500eccc7e
Parents: aab4c74
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Fri May 11 12:44:11 2018 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Fri May 11 12:44:11 2018 +0800

----------------------------------------------------------------------
 .../apache/kerby/has/server/kdc/HasKdcHandler.java  | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/95440dc9/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/HasKdcHandler.java
----------------------------------------------------------------------
diff --git a/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/HasKdcHandler.java
b/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/HasKdcHandler.java
index ce60739..e209a7c 100644
--- a/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/HasKdcHandler.java
+++ b/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/HasKdcHandler.java
@@ -27,6 +27,10 @@ import org.apache.kerby.kerberos.kerb.KrbException;
 import org.apache.kerby.kerberos.kerb.client.KrbContext;
 import org.apache.kerby.kerberos.kerb.common.EncryptionUtil;
 import org.apache.kerby.kerberos.kerb.common.KrbUtil;
+import org.apache.kerby.kerberos.kerb.identity.CacheableIdentityService;
+import org.apache.kerby.kerberos.kerb.identity.IdentityService;
+import org.apache.kerby.kerberos.kerb.identity.backend.IdentityBackend;
+import org.apache.kerby.kerberos.kerb.identity.backend.MemoryIdentityBackend;
 import org.apache.kerby.kerberos.kerb.server.KdcConfigKey;
 import org.apache.kerby.kerberos.kerb.server.KdcContext;
 import org.apache.kerby.kerberos.kerb.server.KdcRecoverableException;
@@ -93,7 +97,17 @@ public class HasKdcHandler {
 
     private void prepareHandler(KdcServer kdcServer) {
         this.kdcContext = new KdcContext(kdcServer.getKdcSetting());
-        this.kdcContext.setIdentityService(kdcServer.getIdentityService());
+
+        IdentityBackend backend = kdcServer.getIdentityService();
+        IdentityService identityService;
+        if (backend instanceof MemoryIdentityBackend) {
+            identityService = backend;
+        } else {
+            identityService = new CacheableIdentityService(
+                    kdcServer.getBackendConfig(), backend);
+        }
+
+        this.kdcContext.setIdentityService(identityService);
         PreauthHandler preauthHandler = new PreauthHandler();
         preauthHandler.init();
         this.kdcContext.setPreauthHandler(preauthHandler);


Mime
View raw message