treequel 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +92 -67
- data/Rakefile +0 -2
- data/lib/treequel/branch.rb +4 -1
- data/lib/treequel/model/schemavalidations.rb +11 -1
- data/lib/treequel.rb +3 -3
- data/spec/data/schema.yml +439 -381
- data/spec/lib/constants.rb +16 -7
- data/spec/treequel/branch_spec.rb +7 -2
- data/spec/treequel/model/schemavalidations_spec.rb +12 -9
- data/spec/treequel/schema_spec.rb +10 -10
- data.tar.gz.sig +0 -0
- metadata +16 -78
- metadata.gz.sig +0 -0
data/spec/lib/constants.rb
CHANGED
|
@@ -167,8 +167,7 @@ module Treequel::TestConstants # :nodoc:all
|
|
|
167
167
|
],
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
TEST_OPERATIONAL_PEOPLE_ENTRY =
|
|
171
|
-
TEST_PEOPLE_DN_ATTR => [TEST_PEOPLE_DN_VALUE],
|
|
170
|
+
TEST_OPERATIONAL_PEOPLE_ENTRY = TEST_PEOPLE_ENTRY.merge(
|
|
172
171
|
'structuralObjectClass' => ['organizationalUnit'],
|
|
173
172
|
'entryUUID' => ['5035e674-bae3-102b-992e-e9e937d524d6'],
|
|
174
173
|
'creatorsName' => ['cn=admin,dc=laika,dc=com'],
|
|
@@ -178,11 +177,21 @@ module Treequel::TestConstants # :nodoc:all
|
|
|
178
177
|
'modifyTimestamp' => ['20070629232213Z'],
|
|
179
178
|
'entryDN' => [TEST_PEOPLE_DN],
|
|
180
179
|
'subschemaSubentry' => ['cn=Subschema'],
|
|
181
|
-
'hasSubordinates' => ['TRUE']
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
180
|
+
'hasSubordinates' => ['TRUE']
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
TEST_OPERATIONAL_PERSON_ENTRY = TEST_PERSON_ENTRY.merge(
|
|
184
|
+
'structuralObjectClass' => ['inetOrgPerson'],
|
|
185
|
+
'entryUUID' => ['65acd5dc-b146-102f-8d60-c1597577de09'],
|
|
186
|
+
'creatorsName' => ['cn=admin,dc=laika,dc=com'],
|
|
187
|
+
'createTimestamp' => ['20110110204609Z'],
|
|
188
|
+
'entryCSN' => ['20110224232421.753555Z#000000#000#000000'],
|
|
189
|
+
'modifiersName' => ['cn=admin,dc=laika,dc=com'],
|
|
190
|
+
'modifyTimestamp' => ['20110224232421Z'],
|
|
191
|
+
'entryDN' => [TEST_PEOPLE_DN],
|
|
192
|
+
'subschemaSubentry' => ['cn=Subschema'],
|
|
193
|
+
'hasSubordinates' => ['FALSE']
|
|
194
|
+
)
|
|
186
195
|
|
|
187
196
|
|
|
188
197
|
constants.each do |cname|
|
|
@@ -375,9 +375,14 @@ describe Treequel::Branch do
|
|
|
375
375
|
end
|
|
376
376
|
|
|
377
377
|
it "knows what the OIDs of its operational attributes are" do
|
|
378
|
-
|
|
378
|
+
op_numeric_oids = @directory.schema.attribute_types.values.select do |attrtype|
|
|
379
379
|
attrtype.operational?
|
|
380
380
|
end.uniq.map( &:oid )
|
|
381
|
+
op_names = @directory.schema.attribute_types.values.select do |attrtype|
|
|
382
|
+
attrtype.operational?
|
|
383
|
+
end.uniq.map( &:names ).flatten
|
|
384
|
+
|
|
385
|
+
op_oids = op_numeric_oids + op_names
|
|
381
386
|
|
|
382
387
|
@branch.operational_attribute_oids.should have( op_oids.length ).members
|
|
383
388
|
@branch.operational_attribute_oids.should include( *op_oids )
|
|
@@ -462,7 +467,7 @@ describe Treequel::Branch do
|
|
|
462
467
|
"MUST and MAY attributes plus the directory's operational attributes" do
|
|
463
468
|
all_attrs = @branch.valid_attribute_types
|
|
464
469
|
|
|
465
|
-
all_attrs.should have(
|
|
470
|
+
all_attrs.should have( 57 ).members
|
|
466
471
|
all_attrs.should include( @directory.schema.attribute_types[:ou] )
|
|
467
472
|
all_attrs.should include( @directory.schema.attribute_types[:l] )
|
|
468
473
|
end
|
|
@@ -68,23 +68,26 @@ describe Treequel::Model::SchemaValidations do
|
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
it "adds an error if the object has a value for an attribute that isn't in one of its MAY attributes" do
|
|
71
|
-
|
|
72
|
-
entry = {
|
|
73
|
-
'objectClass' => ['person', 'inetOrgPerson'],
|
|
74
|
-
'cn' => ['J. Random'],
|
|
75
|
-
'sn' => ['Hacker'],
|
|
76
|
-
'displayName' => ['Trinket the Trivial']
|
|
77
|
-
}
|
|
78
|
-
@conn.stub( :search_ext2 ).and_return([ entry ])
|
|
71
|
+
@conn.stub( :search_ext2 ).and_return([ TEST_PERSON_ENTRY.dup ])
|
|
79
72
|
|
|
80
73
|
# ..then remove the objectclass that grants it and validate
|
|
81
74
|
@modelobj.object_class -= ['inetOrgPerson']
|
|
82
75
|
@modelobj.should_not be_valid()
|
|
83
76
|
|
|
84
77
|
@modelobj.errors.full_messages.
|
|
85
|
-
should
|
|
78
|
+
should include( "displayName is not allowed by entry's objectClasses" )
|
|
86
79
|
end
|
|
87
80
|
|
|
81
|
+
it "doesn't add errors for operational attributes" do
|
|
82
|
+
@conn.stub( :search_ext2 ).and_return([ TEST_OPERATIONAL_PERSON_ENTRY.dup ])
|
|
83
|
+
@modelobj.l = ['Birmingham']
|
|
84
|
+
@modelobj.validate
|
|
85
|
+
# @modelobj.operational_attribute_oids.should == []
|
|
86
|
+
# @modelobj.should be_valid()
|
|
87
|
+
@modelobj.errors.full_messages.should == []
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
|
|
88
91
|
# AuxiliaryObjectClass ( 1.3.6.1.1.1.2.0 NAME 'posixAccount'
|
|
89
92
|
# DESC 'Abstraction of an account with POSIX attributes'
|
|
90
93
|
# SUP top AUXILIARY
|
|
@@ -51,13 +51,13 @@ describe Treequel::Schema do
|
|
|
51
51
|
|
|
52
52
|
schema = Treequel::Schema.new( schemahash )
|
|
53
53
|
|
|
54
|
-
schema.object_classes.should have(
|
|
55
|
-
schema.attribute_types.should have(
|
|
56
|
-
schema.matching_rules.should have(
|
|
54
|
+
schema.object_classes.should have( 308 ).members
|
|
55
|
+
schema.attribute_types.should have( 1193 ).members
|
|
56
|
+
schema.matching_rules.should have( 74 ).members
|
|
57
57
|
schema.matching_rule_uses.should have( 54 ).members
|
|
58
|
-
schema.ldap_syntaxes.should have(
|
|
58
|
+
schema.ldap_syntaxes.should have( 32 ).members
|
|
59
59
|
|
|
60
|
-
schema.operational_attribute_types.should have(
|
|
60
|
+
schema.operational_attribute_types.should have( 34 ).members
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
|
|
@@ -73,13 +73,13 @@ describe Treequel::Schema do
|
|
|
73
73
|
schema = Treequel::Schema.new( schemahash )
|
|
74
74
|
end.join
|
|
75
75
|
|
|
76
|
-
schema.object_classes.should have(
|
|
77
|
-
schema.attribute_types.should have(
|
|
78
|
-
schema.matching_rules.should have(
|
|
76
|
+
schema.object_classes.should have( 308 ).members
|
|
77
|
+
schema.attribute_types.should have( 1193 ).members
|
|
78
|
+
schema.matching_rules.should have( 74 ).members
|
|
79
79
|
schema.matching_rule_uses.should have( 54 ).members
|
|
80
|
-
schema.ldap_syntaxes.should have(
|
|
80
|
+
schema.ldap_syntaxes.should have( 32 ).members
|
|
81
81
|
|
|
82
|
-
schema.operational_attribute_types.should have(
|
|
82
|
+
schema.operational_attribute_types.should have( 34 ).members
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: treequel
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash: 3
|
|
5
4
|
prerelease:
|
|
6
|
-
|
|
7
|
-
- 1
|
|
8
|
-
- 5
|
|
9
|
-
- 0
|
|
10
|
-
version: 1.5.0
|
|
5
|
+
version: 1.5.1
|
|
11
6
|
platform: ruby
|
|
12
7
|
authors:
|
|
13
8
|
- Michael Granger
|
|
@@ -36,37 +31,29 @@ cert_chain:
|
|
|
36
31
|
cmlhXe46pZNJgWKbxZah85jIjx95hR8vOI+NAM5iH9kOqK13DrxacTKPhqj5PjwF
|
|
37
32
|
-----END CERTIFICATE-----
|
|
38
33
|
|
|
39
|
-
date: 2011-02-
|
|
34
|
+
date: 2011-02-25 00:00:00 -08:00
|
|
40
35
|
default_executable:
|
|
41
36
|
dependencies:
|
|
42
37
|
- !ruby/object:Gem::Dependency
|
|
43
|
-
name:
|
|
38
|
+
name: ruby-ldap
|
|
44
39
|
prerelease: false
|
|
45
40
|
requirement: &id001 !ruby/object:Gem::Requirement
|
|
46
41
|
none: false
|
|
47
42
|
requirements:
|
|
48
43
|
- - ~>
|
|
49
44
|
- !ruby/object:Gem::Version
|
|
50
|
-
|
|
51
|
-
segments:
|
|
52
|
-
- 1
|
|
53
|
-
- 1
|
|
54
|
-
version: "1.1"
|
|
45
|
+
version: "0.9"
|
|
55
46
|
type: :runtime
|
|
56
47
|
version_requirements: *id001
|
|
57
48
|
- !ruby/object:Gem::Dependency
|
|
58
|
-
name:
|
|
49
|
+
name: diff-lcs
|
|
59
50
|
prerelease: false
|
|
60
51
|
requirement: &id002 !ruby/object:Gem::Requirement
|
|
61
52
|
none: false
|
|
62
53
|
requirements:
|
|
63
54
|
- - ~>
|
|
64
55
|
- !ruby/object:Gem::Version
|
|
65
|
-
|
|
66
|
-
segments:
|
|
67
|
-
- 0
|
|
68
|
-
- 9
|
|
69
|
-
version: "0.9"
|
|
56
|
+
version: "1.1"
|
|
70
57
|
type: :runtime
|
|
71
58
|
version_requirements: *id002
|
|
72
59
|
- !ruby/object:Gem::Dependency
|
|
@@ -77,11 +64,6 @@ dependencies:
|
|
|
77
64
|
requirements:
|
|
78
65
|
- - ~>
|
|
79
66
|
- !ruby/object:Gem::Version
|
|
80
|
-
hash: 29
|
|
81
|
-
segments:
|
|
82
|
-
- 1
|
|
83
|
-
- 2
|
|
84
|
-
- 1
|
|
85
67
|
version: 1.2.1
|
|
86
68
|
type: :development
|
|
87
69
|
version_requirements: *id003
|
|
@@ -93,27 +75,18 @@ dependencies:
|
|
|
93
75
|
requirements:
|
|
94
76
|
- - ">="
|
|
95
77
|
- !ruby/object:Gem::Version
|
|
96
|
-
hash: 31
|
|
97
|
-
segments:
|
|
98
|
-
- 0
|
|
99
|
-
- 1
|
|
100
|
-
- 2
|
|
101
78
|
version: 0.1.2
|
|
102
79
|
type: :development
|
|
103
80
|
version_requirements: *id004
|
|
104
81
|
- !ruby/object:Gem::Dependency
|
|
105
|
-
name:
|
|
82
|
+
name: rspec
|
|
106
83
|
prerelease: false
|
|
107
84
|
requirement: &id005 !ruby/object:Gem::Requirement
|
|
108
85
|
none: false
|
|
109
86
|
requirements:
|
|
110
87
|
- - ~>
|
|
111
88
|
- !ruby/object:Gem::Version
|
|
112
|
-
|
|
113
|
-
segments:
|
|
114
|
-
- 0
|
|
115
|
-
- 3
|
|
116
|
-
version: "0.3"
|
|
89
|
+
version: "2.4"
|
|
117
90
|
type: :development
|
|
118
91
|
version_requirements: *id005
|
|
119
92
|
- !ruby/object:Gem::Dependency
|
|
@@ -124,10 +97,6 @@ dependencies:
|
|
|
124
97
|
requirements:
|
|
125
98
|
- - ~>
|
|
126
99
|
- !ruby/object:Gem::Version
|
|
127
|
-
hash: 25
|
|
128
|
-
segments:
|
|
129
|
-
- 0
|
|
130
|
-
- 9
|
|
131
100
|
version: "0.9"
|
|
132
101
|
type: :development
|
|
133
102
|
version_requirements: *id006
|
|
@@ -139,56 +108,40 @@ dependencies:
|
|
|
139
108
|
requirements:
|
|
140
109
|
- - ~>
|
|
141
110
|
- !ruby/object:Gem::Version
|
|
142
|
-
hash: 9
|
|
143
|
-
segments:
|
|
144
|
-
- 0
|
|
145
|
-
- 1
|
|
146
111
|
version: "0.1"
|
|
147
112
|
type: :development
|
|
148
113
|
version_requirements: *id007
|
|
149
114
|
- !ruby/object:Gem::Dependency
|
|
150
|
-
name:
|
|
115
|
+
name: columnize
|
|
151
116
|
prerelease: false
|
|
152
117
|
requirement: &id008 !ruby/object:Gem::Requirement
|
|
153
118
|
none: false
|
|
154
119
|
requirements:
|
|
155
120
|
- - ~>
|
|
156
121
|
- !ruby/object:Gem::Version
|
|
157
|
-
|
|
158
|
-
segments:
|
|
159
|
-
- 2
|
|
160
|
-
- 4
|
|
161
|
-
version: "2.4"
|
|
122
|
+
version: "0.3"
|
|
162
123
|
type: :development
|
|
163
124
|
version_requirements: *id008
|
|
164
125
|
- !ruby/object:Gem::Dependency
|
|
165
|
-
name:
|
|
126
|
+
name: sysexits
|
|
166
127
|
prerelease: false
|
|
167
128
|
requirement: &id009 !ruby/object:Gem::Requirement
|
|
168
129
|
none: false
|
|
169
130
|
requirements:
|
|
170
131
|
- - ~>
|
|
171
132
|
- !ruby/object:Gem::Version
|
|
172
|
-
|
|
173
|
-
segments:
|
|
174
|
-
- 3
|
|
175
|
-
- 20
|
|
176
|
-
version: "3.20"
|
|
133
|
+
version: "1.0"
|
|
177
134
|
type: :development
|
|
178
135
|
version_requirements: *id009
|
|
179
136
|
- !ruby/object:Gem::Dependency
|
|
180
|
-
name:
|
|
137
|
+
name: sequel
|
|
181
138
|
prerelease: false
|
|
182
139
|
requirement: &id010 !ruby/object:Gem::Requirement
|
|
183
140
|
none: false
|
|
184
141
|
requirements:
|
|
185
142
|
- - ~>
|
|
186
143
|
- !ruby/object:Gem::Version
|
|
187
|
-
|
|
188
|
-
segments:
|
|
189
|
-
- 1
|
|
190
|
-
- 0
|
|
191
|
-
version: "1.0"
|
|
144
|
+
version: "3.20"
|
|
192
145
|
type: :development
|
|
193
146
|
version_requirements: *id010
|
|
194
147
|
- !ruby/object:Gem::Dependency
|
|
@@ -199,11 +152,6 @@ dependencies:
|
|
|
199
152
|
requirements:
|
|
200
153
|
- - ">="
|
|
201
154
|
- !ruby/object:Gem::Version
|
|
202
|
-
hash: 41
|
|
203
|
-
segments:
|
|
204
|
-
- 2
|
|
205
|
-
- 9
|
|
206
|
-
- 1
|
|
207
155
|
version: 2.9.1
|
|
208
156
|
type: :development
|
|
209
157
|
version_requirements: *id011
|
|
@@ -312,11 +260,9 @@ post_install_message: |-
|
|
|
312
260
|
You can install them automatically if you use the --development flag when
|
|
313
261
|
installing Treequel.
|
|
314
262
|
rdoc_options:
|
|
315
|
-
- --use-cache
|
|
316
|
-
- --protected
|
|
317
|
-
- --verbose
|
|
318
263
|
- --title
|
|
319
264
|
- Treequel Documentation
|
|
265
|
+
- --quiet
|
|
320
266
|
require_paths:
|
|
321
267
|
- lib
|
|
322
268
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
@@ -324,25 +270,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
324
270
|
requirements:
|
|
325
271
|
- - ">="
|
|
326
272
|
- !ruby/object:Gem::Version
|
|
327
|
-
hash: 57
|
|
328
|
-
segments:
|
|
329
|
-
- 1
|
|
330
|
-
- 8
|
|
331
|
-
- 7
|
|
332
273
|
version: 1.8.7
|
|
333
274
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
334
275
|
none: false
|
|
335
276
|
requirements:
|
|
336
277
|
- - ">="
|
|
337
278
|
- !ruby/object:Gem::Version
|
|
338
|
-
hash: 3
|
|
339
|
-
segments:
|
|
340
|
-
- 0
|
|
341
279
|
version: "0"
|
|
342
280
|
requirements: []
|
|
343
281
|
|
|
344
282
|
rubyforge_project: treequel
|
|
345
|
-
rubygems_version: 1.5.
|
|
283
|
+
rubygems_version: 1.5.2
|
|
346
284
|
signing_key:
|
|
347
285
|
specification_version: 3
|
|
348
286
|
summary: Treequel is an LDAP toolkit for Ruby
|
metadata.gz.sig
CHANGED
|
Binary file
|