Skip to content

handle base64 encoded dn attr #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

mattias-ohlsson
Copy link
Contributor

DN can be base64 encoded.

RFC 2849:

base64-distinguishedName = BASE64-UTF8-STRING
                           ; a distinguishedName which has been base64
                           ; encoded (see note 10, below)

@jch
Copy link
Member

jch commented Oct 8, 2014

@mattias-ohlsson Can you add a test for this?

def test_ldif_with_base64_dn
str = "dn:: Q049QmFzZTY0IGRuIHRlc3QsT1U9VGVzdCxPVT1Vbml0cyxEQz1leGFtcGxlLERDPWNvbQ==\r\n\r\n"
ds = Net::LDAP::Dataset::read_ldif(StringIO.new(str))
assert_equal(true, ds.has_key?("CN=Base64 dn test,OU=Test,OU=Units,DC=example,DC=com"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert ... is equivalent to assert_equal true, ..., but also check out assert_predicate.

I see that this is just based off other tests in the file, though. I'm happy to take care of cleaning those up separately.

@mtodd
Copy link
Member

mtodd commented Oct 12, 2014

Merge master in and fix merge conflicts (should be pretty minor) and I can get this merged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants