Skip to content

Commit 4191647

Browse files
author
Jerry Cheung
committed
Merge remote-tracking branch 'origin/master' into release-scripts
2 parents bee19ae + d47607a commit 4191647

File tree

7 files changed

+140
-31
lines changed

7 files changed

+140
-31
lines changed

CONTRIBUTING.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Contribution guide
2+
3+
Thank you for using net-ldap. If you'd like to help, keep these guidelines in
4+
mind.
5+
6+
## Submitting a New Issue
7+
8+
If you find a bug, or would like to propose an idea, file a [new issue][issues].
9+
Include as many details as possible:
10+
11+
- Version of net-ldap gem
12+
- LDAP server version
13+
- Queries, connection information, any other input
14+
- output or error messages
15+
16+
## Sending a Pull Request
17+
18+
[Pull requests][pr] are always welcome!
19+
20+
Check out [the project's issues list][issues] for ideas on what could be improved.
21+
22+
Before sending, please add tests and ensure the test suite passes.
23+
24+
To run the full suite:
25+
26+
`bundle exec rake`
27+
28+
To run a specific test file:
29+
30+
`bundle exec ruby test/test_ldap.rb`
31+
32+
To run a specific test:
33+
34+
`bundle exec ruby test/test_ldap.rb -n test_instrument_bind`
35+
36+
Pull requests will trigger automatic continuous integration builds on
37+
[TravisCI][travis]. To run integration tests locally, see the `test/support`
38+
folder.
39+
40+
## Styleguide
41+
42+
```ruby
43+
# 1.9+ style hashes
44+
{key: "value"}
45+
46+
# Multi-line arguments with `\`
47+
MyClass.new \
48+
foo: 'bar',
49+
baz: 'garply'
50+
```
51+
52+
[issues]: https://github.com/ruby-net-ldap/ruby-net-ldap/issues
53+
[pr]: https://help.github.com/articles/using-pull-requests
54+
[travis]: https://travis-ci.org/ruby-ldap/ruby-net-ldap

History.rdoc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
=== Net::LDAP 0.9.0
2+
* Major changes:
3+
* Dropped support for ruby 1.8.7, ruby >= 1.9.3 now required
4+
* Major enhancements:
5+
* Add support for search time limit parameter
6+
* Instrument received messages, PDU parsing
7+
* Minor enhancments:
8+
* Add support for querying ActiveDirectory capabilities from root dse
9+
* Bug fixes:
10+
* Fix reads for multiple concurrent requests with shared, open connections mixing up the results
11+
* Fix search size option
12+
* Fix BER encoding bug
13+
* Code clean-up:
14+
* Added integration test suite
15+
* Switch to minitest
16+
17+
* Details
18+
* #150 Support querying ActiveDirectory capabilities when searching root dse
19+
* #142 Encode true as xFF
20+
* #124, #145, #146 Cleanup gemspec
21+
* #138, #144 Track response messages by message id
22+
* #141 Magic number/constant cleanup
23+
* #119, #129, #130, #132, #133, #137 Integration tests
24+
* #115 Search timeout support
25+
* #140 Fix search size option
26+
* #139 Cleanup and inline documentation for Net::LDAP::Connection#search
27+
* #131 Instrumentation
28+
* #116 Refactor Connection#write
29+
* #126 Update gitignore
30+
* #128 Fix whitespace
31+
* #113, #121 Switch to minitest
32+
* #123 Base64 encoded dn
33+
* #114 Separate file for Net::LDAP::Connection
34+
* #104 Parse version spec in LDIF datasets
35+
* #106 ldap.modify doc fixes
36+
* #111 Fix test deprecations
37+
138
=== Net::LDAP 0.5.0 / 2013-07-22
239
* Major changes:
340
* Required Ruby version is >=1.9.3

lib/net/ber/core_ext/true_class.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ module Net::BER::Extensions::TrueClass
55
##
66
# Converts +true+ to the BER wireline representation of +true+.
77
def to_ber
8-
# 20100319 AZ: Note that this may not be the completely correct value,
9-
# per some test documentation. We need to determine the truth of this.
10-
"\001\001\001"
8+
# http://tools.ietf.org/html/rfc4511#section-5.1
9+
"\001\001\xFF".force_encoding("ASCII-8BIT")
1110
end
1211
end

lib/net/ldap.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,9 +1194,16 @@ def delete_tree(args)
11941194
def search_root_dse
11951195
rs = search(:ignore_server_caps => true, :base => "",
11961196
:scope => SearchScope_BaseObject,
1197-
:attributes => [ :namingContexts, :supportedLdapVersion,
1198-
:altServer, :supportedControl, :supportedExtension,
1199-
:supportedFeatures, :supportedSASLMechanisms])
1197+
:attributes => [
1198+
:altServer,
1199+
:namingContexts,
1200+
:supportedCapabilities,
1201+
:supportedControl,
1202+
:supportedExtension,
1203+
:supportedFeatures,
1204+
:supportedLdapVersion,
1205+
:supportedSASLMechanisms
1206+
])
12001207
(rs and rs.first) or Net::LDAP::Entry.new
12011208
end
12021209

net-ldap.gemspec

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Gem::Specification.new do |s|
77
s.name = %q{net-ldap}
88
s.version = Net::LDAP::VERSION
99
s.license = "MIT"
10-
11-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
1210
s.authors = ["Francis Cianfrocca", "Emiel van de Laar", "Rory O'Connell", "Kaspar Schiess", "Austin Ziegler", "Michael Schaarschmidt"]
1311
s.date = %q{2012-02-28}
1412
s.description = %q{Net::LDAP for Ruby (also called net-ldap) implements client access for the
@@ -29,28 +27,11 @@ the most recent LDAP RFCs (4510-4519, plutions of 4520-4532).}
2927
s.homepage = %q{http://github.com/ruby-ldap/ruby-net-ldap}
3028
s.rdoc_options = ["--main", "README.rdoc"]
3129
s.require_paths = ["lib"]
32-
s.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
33-
s.rubygems_version = %q{1.5.2}
30+
s.required_ruby_version = ">= 1.9.3"
3431
s.summary = %q{Net::LDAP for Ruby (also called net-ldap) implements client access for the Lightweight Directory Access Protocol (LDAP), an IETF standard protocol for accessing distributed directory services}
3532

36-
if s.respond_to? :specification_version then
37-
s.specification_version = 3
38-
39-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
40-
s.add_development_dependency(%q<hoe-git>, ["~> 1"])
41-
s.add_development_dependency(%q<hoe-gemspec>, ["~> 1"])
42-
s.add_development_dependency(%q<flexmock>, [">= 1.3.0"])
43-
s.add_development_dependency(%q<hoe>, [">= 2.9.1"])
44-
else
45-
s.add_dependency(%q<hoe-git>, ["~> 1"])
46-
s.add_dependency(%q<hoe-gemspec>, ["~> 1"])
47-
s.add_dependency(%q<flexmock>, [">= 1.3.0"])
48-
s.add_dependency(%q<hoe>, [">= 2.9.1"])
49-
end
50-
else
51-
s.add_dependency(%q<hoe-git>, ["~> 1"])
52-
s.add_dependency(%q<hoe-gemspec>, ["~> 1"])
53-
s.add_dependency(%q<flexmock>, [">= 1.3.0"])
54-
s.add_dependency(%q<hoe>, [">= 2.9.1"])
55-
end
33+
s.add_development_dependency("hoe-git", "~> 1")
34+
s.add_development_dependency("hoe-gemspec", "~> 1")
35+
s.add_development_dependency("flexmock", ">= 1.3.0")
36+
s.add_development_dependency("hoe", ">= 2.9.1")
5637
end

test/ber/test_ber.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ def test_array
1212
assert_equal ary, encoded_ary.read_ber
1313
end
1414

15+
# http://tools.ietf.org/html/rfc4511#section-5.1
1516
def test_true
16-
assert_equal "\x01\x01\x01", true.to_ber
17+
assert_equal "\x01\x01\xFF".b, true.to_ber
1718
end
1819

1920
def test_false

test/integration/test_ber.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
require_relative '../test_helper'
2+
3+
class TestBERIntegration < LDAPIntegrationTestCase
4+
# Test whether the TRUE boolean value is encoded correctly by performing a
5+
# search operation.
6+
def test_true_ber_encoding
7+
# request these attrs to simplify test; use symbols to match Entry#attribute_names
8+
attrs = [:dn, :uid, :cn, :mail]
9+
10+
assert types_entry = @ldap.search(
11+
base: "dc=rubyldap,dc=com",
12+
filter: "(uid=user1)",
13+
size: 1,
14+
attributes: attrs,
15+
attributes_only: true
16+
).first
17+
18+
# matches attributes we requested
19+
assert_equal attrs, types_entry.attribute_names
20+
21+
# assert values are empty
22+
types_entry.each do |name, values|
23+
next if name == :dn
24+
assert values.empty?
25+
end
26+
27+
assert_includes Net::LDAP::ResultCodesSearchSuccess,
28+
@ldap.get_operation_result.code, "should be a successful search operation"
29+
end
30+
end

0 commit comments

Comments
 (0)