Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow empty entries with :dn set

  • Loading branch information...
commit 9acf5ff582ea9431584b149efb9fc065ccf12f15 1 parent f8d56f2
@alienscience authored
Showing with 5 additions and 6 deletions.
  1. +4 −5 src/clj_ldap/client.clj
  2. +1 −1  test/clj_ldap/test/client.clj
View
9 src/clj_ldap/client.clj
@@ -131,11 +131,10 @@
(defn- entry-as-map
"Converts an Entry object into a map"
[entry]
- (let [col-a (.getAttributes entry)]
- (if (> (.size col-a) 0)
- (let [attrs (seq col-a)]
- (apply hash-map :dn (.getDN entry)
- (mapcat extract-attribute attrs))))))
+ (let [col-a (.getAttributes entry)
+ attrs (seq (.getAttributes entry))]
+ (apply hash-map :dn (.getDN entry)
+ (mapcat extract-attribute attrs))))
(defn- set-entry-kv!
"Sets the given key/value pair in the given entry object"
View
2  test/clj_ldap/test/client.clj
@@ -181,7 +181,7 @@
(deftest test-search
(is (= (set (map :cn
(ldap/search *conn* base* {:attributes [:cn]})))
- (set ["testa" "testb" "Saul Hazledine"])))
+ (set [nil "testa" "testb" "Saul Hazledine"])))
(is (= (set (map :cn
(ldap/search *conn* base*
{:attributes [:cn] :filter "cn=test*"})))
Please sign in to comment.
Something went wrong with that request. Please try again.