15 lines
447 B
Crystal
15 lines
447 B
Crystal
require "./spec_helper"
|
|
|
|
describe LdapEscape do
|
|
describe "#filter" do
|
|
it "filters out malicious filter characters" do
|
|
LdapEscape.filter("\u0000\u0028\u0029\u002a\u005c").should eq "\\00\\28\\29\\2a\\5c"
|
|
end
|
|
end
|
|
|
|
describe "#dn" do
|
|
it "filters out malicious dn characters" do
|
|
LdapEscape.dn("\u0020\u0022\u0023\u002b\u002c\u003b\u003c\u003d\u003e\u005c").should eq "\\\\ \\\"\\#\\+\\,\\;\\<\\=\\>\\\\"
|
|
end
|
|
end
|
|
end
|