-
Notifications
You must be signed in to change notification settings - Fork 253
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
Add support for ldapwhoami (RFC4532) (now with tests) #425
Changes from 5 commits
1a27513
0e38c4a
1d38606
d5e82fa
c3320a0
3f33379
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,13 +194,13 @@ def parse_ldap_result(sequence) | |
# requestValue [1] OCTET STRING OPTIONAL } | ||
|
||
def parse_extended_response(sequence) | ||
sequence.length >= 3 or raise Net::LDAP::PDU::Error, "Invalid LDAP result length." | ||
sequence.length.between?(3, 5) or raise Net::LDAP::PDU::Error, "Invalid LDAP result length." | ||
@ldap_result = { | ||
:resultCode => sequence[0], | ||
:matchedDN => sequence[1], | ||
:errorMessage => sequence[2], | ||
} | ||
@extended_response = sequence[3] | ||
@extended_response = sequence.last | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the idea here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an optional field that's included when the target is Active Directory that shifts the index. This accounts for both cases by accessing it as the last member. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, as long as it works with other LDAP directories |
||
end | ||
private :parse_extended_response | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this change in place, the reply would cause an exception to be raised when it was being parsed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is fine if it doesn't break other queries