directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject directory-kerby git commit: [DIRKRB-294]-Implementing doDeleteIdentity for LdapIdentityBackend. Contributed by Yaning.
Date Mon, 22 Jun 2015 19:31:54 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 69a72b0cf -> 5c5c27d64


[DIRKRB-294]-Implementing doDeleteIdentity for LdapIdentityBackend. Contributed by Yaning.


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

Branch: refs/heads/master
Commit: 5c5c27d64a70fbd2217ecdbdd02d029c7f3bee9b
Parents: 69a72b0
Author: Stefan Seelmann <mail@stefan-seelmann.de>
Authored: Mon Jun 22 21:31:11 2015 +0200
Committer: Stefan Seelmann <mail@stefan-seelmann.de>
Committed: Mon Jun 22 21:31:11 2015 +0200

----------------------------------------------------------------------
 .../kerberos/kdc/identitybackend/LdapIdentityBackend.java   | 9 ++++++++-
 .../kerb/identity/backend/LdapIdentityBackendTest.java      | 5 +++++
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5c5c27d6/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityBackend.java
----------------------------------------------------------------------
diff --git a/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityBackend.java
b/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityBackend.java
index 68bbb50..6e0cf12 100644
--- a/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityBackend.java
+++ b/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityBackend.java
@@ -230,7 +230,14 @@ public class LdapIdentityBackend extends AbstractIdentityBackend {
 
     @Override
     protected void doDeleteIdentity(String principalName) {
-
+        String[] names = principalName.split("@");
+        String uid = names[0];
+        try {
+            Dn dn = new Dn(new Rdn("uid", uid), new Dn(BASE_DN));
+            connection.delete(dn);
+        } catch (LdapException e) {
+            e.printStackTrace();
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5c5c27d6/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/LdapIdentityBackendTest.java
----------------------------------------------------------------------
diff --git a/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/LdapIdentityBackendTest.java
b/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/LdapIdentityBackendTest.java
index e841fae..8ad5cf3 100644
--- a/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/LdapIdentityBackendTest.java
+++ b/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/LdapIdentityBackendTest.java
@@ -90,4 +90,9 @@ public class LdapIdentityBackendTest extends AbstractLdapIdentityBackendTest
     public void testUpdate() {
         super.testUpdate(backend);
     }
+
+    @Test
+    public void testDelete() {
+        super.testDelete(backend);
+    }
 }
\ No newline at end of file


Mime
View raw message