mxhero-api 0.1.15 → 0.1.16
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.
- checksums.yaml +15 -0
- data/VERSION +1 -1
- data/lib/mxhero-api.rb +58 -11
- data/mxhero-api.gemspec +7 -6
- data/test/fixtures/api/ldap_info.yml +39 -0
- data/test/fixtures/api/test_domain.yml +75 -0
- data/test/test_mxhero_api.rb +53 -24
- metadata +9 -16
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZTkxYTllMDVlMDk4ZjdiZmFjMGY3N2E4Y2FmMTUwYTI2NTFjMzhmMA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YTNlM2I1MmVmMzViMjJiMjZmZThjMjg1YmEzNmEwZmVlYzllYjQyZg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MjU2M2MzYTAwZDViODMwZGYzYjJiMjY4MWE4NTQyN2NmM2E0N2IzN2UwNzEy
|
10
|
+
NjQ4YWQ2YjAyYjA3OGI3NzMyODA1NzlmYmEwZmVkMDZhNWY5YzQ3YzdmMDU4
|
11
|
+
OWU0MmU4YjY2NDVlMTAzMGUxMjc4NWRiNTQxZTRlOTI2NWJjNjA=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YmFjOTBmZmU0Yjk2NmI0ZDYwMjA0ZTE5NmM0OWRjOTdhMGU0ODI2NGE3MThl
|
14
|
+
YjFjZGJjM2IzNGYxYmViYzYxZjJlN2U3NTg2MWUyZjVlMWU4N2MyY2ZkMzA4
|
15
|
+
YjkxMDc3MDZhNTRkYmI2NmRkZjMyMjliNTlhMTg1Yjc2ODkzYjg=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.16
|
data/lib/mxhero-api.rb
CHANGED
@@ -129,25 +129,54 @@ module MxHero::API
|
|
129
129
|
response_as_a_hash
|
130
130
|
end
|
131
131
|
|
132
|
-
|
133
|
-
#
|
134
|
-
#
|
132
|
+
|
133
|
+
# Retrive the domain information
|
134
|
+
#
|
135
|
+
# @param name The domain name or id. For example: 'mydomain.com'
|
135
136
|
# @return [Hash] with the domain attributes if exist
|
136
137
|
# * :domain [String]
|
137
138
|
# * :server [String]
|
138
139
|
# * :creationDate [Fixnum]
|
139
140
|
# * :updateDate [Fixnum]
|
140
|
-
# * :aliases
|
141
|
+
# * :aliases [Array<String>]
|
141
142
|
# * :ldap
|
142
|
-
#
|
143
|
-
#
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
143
|
+
#
|
144
|
+
# Or nil if not found
|
145
|
+
#
|
146
|
+
# @raise an exception when the status code is not 200 (ok) or 404 (not found)
|
147
|
+
#
|
148
|
+
def domain(name)
|
149
|
+
fetch domain_by_id_url(name),
|
150
|
+
on_error: "An error ocurred when try to fetch the domain #{name}."
|
151
|
+
end
|
152
|
+
|
153
|
+
|
154
|
+
# Fetch the LDAP information of the domain
|
155
|
+
#
|
156
|
+
# @return [Hash] with
|
157
|
+
# * :domain
|
158
|
+
# * :directoryType
|
159
|
+
# * :addres
|
160
|
+
# * :port
|
161
|
+
# * :sslFlag [Boolean]
|
162
|
+
# * :user
|
163
|
+
# * :password
|
164
|
+
# * :filter
|
165
|
+
# * :base
|
166
|
+
# * :nextUpdate
|
167
|
+
# * :lastUpdate
|
168
|
+
# * :error
|
169
|
+
# * :overrideFlag
|
170
|
+
# * :dnAuthenticate
|
171
|
+
# * :properties [Array]
|
172
|
+
#
|
173
|
+
def ldap_info(domain)
|
174
|
+
fetch domain_by_id_url(domain) + '/adldap',
|
175
|
+
on_error: "An error was ocurred when try to fecht the ldap information of #{domain}"
|
149
176
|
end
|
150
177
|
|
178
|
+
|
179
|
+
|
151
180
|
#
|
152
181
|
# Retrive all the account from one domain
|
153
182
|
#
|
@@ -318,6 +347,24 @@ module MxHero::API
|
|
318
347
|
# --------------------------------------------------------------------------------------------------------------------------------
|
319
348
|
private
|
320
349
|
|
350
|
+
# Fetch an element from an URL. That element maybe not found
|
351
|
+
# @return a Hash when the element exist. Or return nil when not found.
|
352
|
+
#
|
353
|
+
# @raise RuntimeError when an error ocurrs.
|
354
|
+
def fetch(url, msg)
|
355
|
+
response = call(:get, url)
|
356
|
+
return json_parse(response.content) if response.ok?
|
357
|
+
return nil if response.code == 404
|
358
|
+
|
359
|
+
error = msg[:on_error] + " HTTP code: #{response.code}"
|
360
|
+
if response.content.include?('message')
|
361
|
+
hash = json_parse(response.content)
|
362
|
+
error << " Response message: #{hash[:message]}"
|
363
|
+
end
|
364
|
+
|
365
|
+
raise error
|
366
|
+
end
|
367
|
+
|
321
368
|
def remap_properties(properties)
|
322
369
|
return nil if properties.nil?
|
323
370
|
properties.keys.map { |name| { name: name, value: properties[name] } }
|
data/mxhero-api.gemspec
CHANGED
@@ -1,24 +1,25 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
# stub: mxhero-api 0.1.16 ruby lib
|
2
3
|
|
3
4
|
Gem::Specification.new do |s|
|
4
5
|
s.name = "mxhero-api"
|
5
|
-
s.version = "0.1.
|
6
|
+
s.version = "0.1.16"
|
6
7
|
|
7
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
9
|
s.authors = ["Maximiliano Dello Russo", "Juan Pablo Royo", "mxHero"]
|
9
|
-
s.date = "2013-10-
|
10
|
+
s.date = "2013-10-21"
|
10
11
|
s.description = "A gem to provide easy access to the API of MxHero platform (http://www.mxhero.com/)"
|
11
12
|
s.email = ["maxidr@mxhero.com", "juanpablo.royo@gmail.com", "mxhero@mxhero.com"]
|
12
|
-
s.files = [".gitignore", ".rvmrc", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "VERSION", "lib/communication.rb", "lib/dto.rb", "lib/groups.rb", "lib/mxhero-api.rb", "lib/urls.rb", "mxhero-api.gemspec", "test/fixtures/api/account_properties.yml", "test/fixtures/api/account_properties_not_found.yml", "test/fixtures/api/accounts.yml", "test/fixtures/api/accounts_filtered.yml", "test/fixtures/api/accounts_from_domain.yml", "test/fixtures/api/accounts_from_domain_paginated.yml", "test/fixtures/api/accounts_without_group.yml", "test/fixtures/api/add_an_inexistent_account_to_group.yml", "test/fixtures/api/add_and_remove_account.yml", "test/fixtures/api/all_groups.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/delete_group.yml", "test/fixtures/api/delete_rule.yml", "test/fixtures/api/domain_by_id.yml", "test/fixtures/api/domain_by_id_not_found.yml", "test/fixtures/api/domain_rule.yml", "test/fixtures/api/domains.yml", "test/fixtures/api/remove_account_from_group_twice.yml", "test/fixtures/api/remove_inexistente_account_from_group.yml", "test/fixtures/api/rules_for_domain.yml", "test/fixtures/api/rules_for_domain_by_component.yml", "test/fixtures/api/save_group.yml", "test/fixtures/api/update_account_properties.yml", "test/fixtures/api/update_accounts_group_scope.yml", "test/fixtures/api/update_accounts_properties_scope.yml", "test/fixtures/api/update_rule.yml", "test/helper.rb", "test/test_dto.rb", "test/test_groups.rb", "test/test_mxhero_api.rb", "test/test_mxhero_api_response.rb"]
|
13
|
+
s.files = [".gitignore", ".rvmrc", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "VERSION", "lib/communication.rb", "lib/dto.rb", "lib/groups.rb", "lib/mxhero-api.rb", "lib/urls.rb", "mxhero-api.gemspec", "test/fixtures/api/account_properties.yml", "test/fixtures/api/account_properties_not_found.yml", "test/fixtures/api/accounts.yml", "test/fixtures/api/accounts_filtered.yml", "test/fixtures/api/accounts_from_domain.yml", "test/fixtures/api/accounts_from_domain_paginated.yml", "test/fixtures/api/accounts_without_group.yml", "test/fixtures/api/add_an_inexistent_account_to_group.yml", "test/fixtures/api/add_and_remove_account.yml", "test/fixtures/api/all_groups.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/delete_group.yml", "test/fixtures/api/delete_rule.yml", "test/fixtures/api/domain_by_id.yml", "test/fixtures/api/domain_by_id_not_found.yml", "test/fixtures/api/domain_rule.yml", "test/fixtures/api/domains.yml", "test/fixtures/api/ldap_info.yml", "test/fixtures/api/remove_account_from_group_twice.yml", "test/fixtures/api/remove_inexistente_account_from_group.yml", "test/fixtures/api/rules_for_domain.yml", "test/fixtures/api/rules_for_domain_by_component.yml", "test/fixtures/api/save_group.yml", "test/fixtures/api/test_domain.yml", "test/fixtures/api/update_account_properties.yml", "test/fixtures/api/update_accounts_group_scope.yml", "test/fixtures/api/update_accounts_properties_scope.yml", "test/fixtures/api/update_rule.yml", "test/helper.rb", "test/test_dto.rb", "test/test_groups.rb", "test/test_mxhero_api.rb", "test/test_mxhero_api_response.rb"]
|
13
14
|
s.homepage = "http://github.com/mxhero/mxhero-api"
|
14
15
|
s.licenses = ["GPL-3"]
|
15
16
|
s.require_paths = ["lib"]
|
16
|
-
s.rubygems_version = "1.
|
17
|
+
s.rubygems_version = "2.1.9"
|
17
18
|
s.summary = "A MxHero API client for ruby"
|
18
|
-
s.test_files = ["test/fixtures/api/account_properties.yml", "test/fixtures/api/account_properties_not_found.yml", "test/fixtures/api/accounts.yml", "test/fixtures/api/accounts_filtered.yml", "test/fixtures/api/accounts_from_domain.yml", "test/fixtures/api/accounts_from_domain_paginated.yml", "test/fixtures/api/accounts_without_group.yml", "test/fixtures/api/add_an_inexistent_account_to_group.yml", "test/fixtures/api/add_and_remove_account.yml", "test/fixtures/api/all_groups.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/delete_group.yml", "test/fixtures/api/delete_rule.yml", "test/fixtures/api/domain_by_id.yml", "test/fixtures/api/domain_by_id_not_found.yml", "test/fixtures/api/domain_rule.yml", "test/fixtures/api/domains.yml", "test/fixtures/api/remove_account_from_group_twice.yml", "test/fixtures/api/remove_inexistente_account_from_group.yml", "test/fixtures/api/rules_for_domain.yml", "test/fixtures/api/rules_for_domain_by_component.yml", "test/fixtures/api/save_group.yml", "test/fixtures/api/update_account_properties.yml", "test/fixtures/api/update_accounts_group_scope.yml", "test/fixtures/api/update_accounts_properties_scope.yml", "test/fixtures/api/update_rule.yml", "test/helper.rb", "test/test_dto.rb", "test/test_groups.rb", "test/test_mxhero_api.rb", "test/test_mxhero_api_response.rb"]
|
19
|
+
s.test_files = ["test/fixtures/api/account_properties.yml", "test/fixtures/api/account_properties_not_found.yml", "test/fixtures/api/accounts.yml", "test/fixtures/api/accounts_filtered.yml", "test/fixtures/api/accounts_from_domain.yml", "test/fixtures/api/accounts_from_domain_paginated.yml", "test/fixtures/api/accounts_without_group.yml", "test/fixtures/api/add_an_inexistent_account_to_group.yml", "test/fixtures/api/add_and_remove_account.yml", "test/fixtures/api/all_groups.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/delete_group.yml", "test/fixtures/api/delete_rule.yml", "test/fixtures/api/domain_by_id.yml", "test/fixtures/api/domain_by_id_not_found.yml", "test/fixtures/api/domain_rule.yml", "test/fixtures/api/domains.yml", "test/fixtures/api/ldap_info.yml", "test/fixtures/api/remove_account_from_group_twice.yml", "test/fixtures/api/remove_inexistente_account_from_group.yml", "test/fixtures/api/rules_for_domain.yml", "test/fixtures/api/rules_for_domain_by_component.yml", "test/fixtures/api/save_group.yml", "test/fixtures/api/test_domain.yml", "test/fixtures/api/update_account_properties.yml", "test/fixtures/api/update_accounts_group_scope.yml", "test/fixtures/api/update_accounts_properties_scope.yml", "test/fixtures/api/update_rule.yml", "test/helper.rb", "test/test_dto.rb", "test/test_groups.rb", "test/test_mxhero_api.rb", "test/test_mxhero_api_response.rb"]
|
19
20
|
|
20
21
|
if s.respond_to? :specification_version then
|
21
|
-
s.specification_version =
|
22
|
+
s.specification_version = 4
|
22
23
|
|
23
24
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
24
25
|
s.add_development_dependency(%q<vcr>, ["= 2.5.0"])
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://admin:password@test.mxhero.com/webapi/api/v1/domains/mxhero.com//adldap
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Authorization:
|
15
|
+
- Basic YWRtaW46cGFzc3dvcmQ=
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: !binary |-
|
20
|
+
T0s=
|
21
|
+
headers:
|
22
|
+
!binary "RGF0ZQ==":
|
23
|
+
- !binary |-
|
24
|
+
RnJpLCAxOCBPY3QgMjAxMyAyMTo0MjoxNyBHTVQ=
|
25
|
+
!binary "U2VydmVy":
|
26
|
+
- !binary |-
|
27
|
+
QXBhY2hlLzIuMi4xNCAoVWJ1bnR1KQ==
|
28
|
+
!binary "VHJhbnNmZXItRW5jb2Rpbmc=":
|
29
|
+
- !binary |-
|
30
|
+
Y2h1bmtlZA==
|
31
|
+
!binary "Q29udGVudC1UeXBl":
|
32
|
+
- !binary |-
|
33
|
+
YXBwbGljYXRpb24vanNvbg==
|
34
|
+
body:
|
35
|
+
encoding: US-ASCII
|
36
|
+
string: ! '{"domain":"mxhero.com","directoryType":"gapps","addres":null,"port":null,"sslFlag":false,"user":"1039076283917.apps.googleusercontent.com","password":"B9tHGe2nkLcIyPHKz2eQ6FtM","filter":null,"base":null,"nextUpdate":1379949740000,"lastUpdate":1379946140000,"error":null,"overrideFlag":true,"dnAuthenticate":null,"properties":[]}'
|
37
|
+
http_version:
|
38
|
+
recorded_at: Fri, 18 Oct 2013 21:42:17 GMT
|
39
|
+
recorded_with: VCR 2.5.0
|
@@ -0,0 +1,75 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://admin:password@test.mxhero.com/webapi/api/v1/domains/mxhero.com/
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Authorization:
|
15
|
+
- Basic YWRtaW46cGFzc3dvcmQ=
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: !binary |-
|
20
|
+
T0s=
|
21
|
+
headers:
|
22
|
+
!binary "RGF0ZQ==":
|
23
|
+
- !binary |-
|
24
|
+
RnJpLCAxOCBPY3QgMjAxMyAxOTo1MToyNSBHTVQ=
|
25
|
+
!binary "U2VydmVy":
|
26
|
+
- !binary |-
|
27
|
+
QXBhY2hlLzIuMi4xNCAoVWJ1bnR1KQ==
|
28
|
+
!binary "VHJhbnNmZXItRW5jb2Rpbmc=":
|
29
|
+
- !binary |-
|
30
|
+
Y2h1bmtlZA==
|
31
|
+
!binary "Q29udGVudC1UeXBl":
|
32
|
+
- !binary |-
|
33
|
+
YXBwbGljYXRpb24vanNvbg==
|
34
|
+
body:
|
35
|
+
encoding: US-ASCII
|
36
|
+
string: ! '{"domain":"mxhero.com","server":"gmail.mxhero.com","creationDate":1371220326000,"updatedDate":1375909534000,"aliases":["hero.mx","mxhero.com","mxhero.net","mxhero.org"],"ldap":null}'
|
37
|
+
http_version:
|
38
|
+
recorded_at: Fri, 18 Oct 2013 19:51:25 GMT
|
39
|
+
- request:
|
40
|
+
method: get
|
41
|
+
uri: http://admin:password@test.mxhero.com/webapi/api/v1/domains/xxxx.xxx/
|
42
|
+
body:
|
43
|
+
encoding: US-ASCII
|
44
|
+
string: ''
|
45
|
+
headers:
|
46
|
+
Accept:
|
47
|
+
- application/json
|
48
|
+
Content-Type:
|
49
|
+
- application/json
|
50
|
+
Authorization:
|
51
|
+
- Basic YWRtaW46cGFzc3dvcmQ=
|
52
|
+
response:
|
53
|
+
status:
|
54
|
+
code: 404
|
55
|
+
message: !binary |-
|
56
|
+
Tm90IEZvdW5k
|
57
|
+
headers:
|
58
|
+
!binary "RGF0ZQ==":
|
59
|
+
- !binary |-
|
60
|
+
RnJpLCAxOCBPY3QgMjAxMyAxOTo1MToyNiBHTVQ=
|
61
|
+
!binary "U2VydmVy":
|
62
|
+
- !binary |-
|
63
|
+
QXBhY2hlLzIuMi4xNCAoVWJ1bnR1KQ==
|
64
|
+
!binary "VHJhbnNmZXItRW5jb2Rpbmc=":
|
65
|
+
- !binary |-
|
66
|
+
Y2h1bmtlZA==
|
67
|
+
!binary "Q29udGVudC1UeXBl":
|
68
|
+
- !binary |-
|
69
|
+
YXBwbGljYXRpb24vanNvbg==
|
70
|
+
body:
|
71
|
+
encoding: US-ASCII
|
72
|
+
string: ! '{"status":404,"code":404,"message":"domain.not.found","developerMessage":"domain.not.found","moreInfoUrl":"mailto:support@mxhero.com"}'
|
73
|
+
http_version:
|
74
|
+
recorded_at: Fri, 18 Oct 2013 19:51:26 GMT
|
75
|
+
recorded_with: VCR 2.5.0
|
data/test/test_mxhero_api.rb
CHANGED
@@ -75,30 +75,6 @@ class MxHeroAPITest < MiniTest::Unit::TestCase
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
-
def test_domain_by_id
|
79
|
-
VCR.use_cassette('domain_by_id') do
|
80
|
-
id = domain
|
81
|
-
tesla_domain = @api.domain_by_id(id)
|
82
|
-
assert tesla_domain.key?(:domain)
|
83
|
-
assert tesla_domain.key?(:server)
|
84
|
-
assert tesla_domain.key?(:creationDate)
|
85
|
-
assert tesla_domain.key?(:aliases)
|
86
|
-
assert tesla_domain.key?(:ldap)
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
def test_domain_by_id_not_found
|
91
|
-
VCR.use_cassette('domain_by_id_not_found') do
|
92
|
-
id = "test.notfound.com"
|
93
|
-
tesla_domain = @api.domain_by_id(id)
|
94
|
-
assert tesla_domain[:status] == 404
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
def test_domain_by_id_param_could_not_be_nil
|
99
|
-
assert_raises(RuntimeError) { @api.domain_by_id }
|
100
|
-
end
|
101
|
-
|
102
78
|
def test_accounts_by_domain
|
103
79
|
VCR.use_cassette('accounts_from_domain') do
|
104
80
|
response = @api.accounts_by_domain(domain)
|
@@ -245,7 +221,60 @@ class MxHeroAPITest < MiniTest::Unit::TestCase
|
|
245
221
|
assert_equal original + '011', properties['mobile']
|
246
222
|
end
|
247
223
|
end
|
224
|
+
def test_domain_by_name
|
225
|
+
VCR.use_cassette('domain_by_id') do
|
226
|
+
id = domain
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
|
231
|
+
def test_domain
|
232
|
+
VCR.use_cassette('test_domain') do
|
233
|
+
domain = @api.domain('mxhero.com')
|
234
|
+
assert domain.key?(:domain)
|
235
|
+
assert domain.key?(:server)
|
236
|
+
assert domain.key?(:creationDate)
|
237
|
+
assert domain.key?(:aliases)
|
238
|
+
assert domain.key?(:ldap)
|
239
|
+
|
240
|
+
response = @api.domain('xxxx.xxx')
|
241
|
+
assert response.nil?
|
242
|
+
end
|
243
|
+
|
244
|
+
def @api.call(_, _)
|
245
|
+
Class.new do
|
246
|
+
def ok?
|
247
|
+
false
|
248
|
+
end
|
249
|
+
|
250
|
+
def code
|
251
|
+
500
|
252
|
+
end
|
253
|
+
|
254
|
+
def content
|
255
|
+
""
|
256
|
+
end
|
257
|
+
end.new
|
258
|
+
end
|
259
|
+
|
260
|
+
err = assert_raises ::RuntimeError do
|
261
|
+
@api.domain('nop')
|
262
|
+
end
|
263
|
+
|
264
|
+
assert_match /An error ocurred when try to fetch the domain nop/, err.message
|
265
|
+
assert_match /HTTP code: 500/, err.message
|
266
|
+
end
|
248
267
|
|
268
|
+
def test_ldap_info
|
269
|
+
VCR.use_cassette('ldap_info') do
|
270
|
+
ldap = @api.ldap_info('mxhero.com')
|
271
|
+
%w{domain directoryType addres port sslFlag user password filter
|
272
|
+
base nextUpdate lastUpdate error overrideFlag
|
273
|
+
dnAuthenticate properties}.each do |field|
|
274
|
+
assert ldap.key?(field.to_sym), "must retrieve ldap hash info with key: #{field}"
|
275
|
+
end
|
276
|
+
end
|
277
|
+
end
|
249
278
|
|
250
279
|
private
|
251
280
|
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mxhero-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.16
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Maximiliano Dello Russo
|
@@ -11,12 +10,11 @@ authors:
|
|
11
10
|
autorequire:
|
12
11
|
bindir: bin
|
13
12
|
cert_chain: []
|
14
|
-
date: 2013-10-
|
13
|
+
date: 2013-10-21 00:00:00.000000000 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: vcr
|
18
17
|
requirement: !ruby/object:Gem::Requirement
|
19
|
-
none: false
|
20
18
|
requirements:
|
21
19
|
- - '='
|
22
20
|
- !ruby/object:Gem::Version
|
@@ -24,7 +22,6 @@ dependencies:
|
|
24
22
|
type: :development
|
25
23
|
prerelease: false
|
26
24
|
version_requirements: !ruby/object:Gem::Requirement
|
27
|
-
none: false
|
28
25
|
requirements:
|
29
26
|
- - '='
|
30
27
|
- !ruby/object:Gem::Version
|
@@ -32,7 +29,6 @@ dependencies:
|
|
32
29
|
- !ruby/object:Gem::Dependency
|
33
30
|
name: webmock
|
34
31
|
requirement: !ruby/object:Gem::Requirement
|
35
|
-
none: false
|
36
32
|
requirements:
|
37
33
|
- - '='
|
38
34
|
- !ruby/object:Gem::Version
|
@@ -40,7 +36,6 @@ dependencies:
|
|
40
36
|
type: :development
|
41
37
|
prerelease: false
|
42
38
|
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
39
|
requirements:
|
45
40
|
- - '='
|
46
41
|
- !ruby/object:Gem::Version
|
@@ -48,7 +43,6 @@ dependencies:
|
|
48
43
|
- !ruby/object:Gem::Dependency
|
49
44
|
name: httpclient
|
50
45
|
requirement: !ruby/object:Gem::Requirement
|
51
|
-
none: false
|
52
46
|
requirements:
|
53
47
|
- - '='
|
54
48
|
- !ruby/object:Gem::Version
|
@@ -56,7 +50,6 @@ dependencies:
|
|
56
50
|
type: :runtime
|
57
51
|
prerelease: false
|
58
52
|
version_requirements: !ruby/object:Gem::Requirement
|
59
|
-
none: false
|
60
53
|
requirements:
|
61
54
|
- - '='
|
62
55
|
- !ruby/object:Gem::Version
|
@@ -100,11 +93,13 @@ files:
|
|
100
93
|
- test/fixtures/api/domain_by_id_not_found.yml
|
101
94
|
- test/fixtures/api/domain_rule.yml
|
102
95
|
- test/fixtures/api/domains.yml
|
96
|
+
- test/fixtures/api/ldap_info.yml
|
103
97
|
- test/fixtures/api/remove_account_from_group_twice.yml
|
104
98
|
- test/fixtures/api/remove_inexistente_account_from_group.yml
|
105
99
|
- test/fixtures/api/rules_for_domain.yml
|
106
100
|
- test/fixtures/api/rules_for_domain_by_component.yml
|
107
101
|
- test/fixtures/api/save_group.yml
|
102
|
+
- test/fixtures/api/test_domain.yml
|
108
103
|
- test/fixtures/api/update_account_properties.yml
|
109
104
|
- test/fixtures/api/update_accounts_group_scope.yml
|
110
105
|
- test/fixtures/api/update_accounts_properties_scope.yml
|
@@ -117,30 +112,26 @@ files:
|
|
117
112
|
homepage: http://github.com/mxhero/mxhero-api
|
118
113
|
licenses:
|
119
114
|
- GPL-3
|
115
|
+
metadata: {}
|
120
116
|
post_install_message:
|
121
117
|
rdoc_options: []
|
122
118
|
require_paths:
|
123
119
|
- lib
|
124
120
|
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
-
none: false
|
126
121
|
requirements:
|
127
122
|
- - ! '>='
|
128
123
|
- !ruby/object:Gem::Version
|
129
124
|
version: '0'
|
130
|
-
segments:
|
131
|
-
- 0
|
132
|
-
hash: -4512878157478229079
|
133
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
|
-
none: false
|
135
126
|
requirements:
|
136
127
|
- - ! '>='
|
137
128
|
- !ruby/object:Gem::Version
|
138
129
|
version: '0'
|
139
130
|
requirements: []
|
140
131
|
rubyforge_project:
|
141
|
-
rubygems_version: 1.
|
132
|
+
rubygems_version: 2.1.9
|
142
133
|
signing_key:
|
143
|
-
specification_version:
|
134
|
+
specification_version: 4
|
144
135
|
summary: A MxHero API client for ruby
|
145
136
|
test_files:
|
146
137
|
- test/fixtures/api/account_properties.yml
|
@@ -160,11 +151,13 @@ test_files:
|
|
160
151
|
- test/fixtures/api/domain_by_id_not_found.yml
|
161
152
|
- test/fixtures/api/domain_rule.yml
|
162
153
|
- test/fixtures/api/domains.yml
|
154
|
+
- test/fixtures/api/ldap_info.yml
|
163
155
|
- test/fixtures/api/remove_account_from_group_twice.yml
|
164
156
|
- test/fixtures/api/remove_inexistente_account_from_group.yml
|
165
157
|
- test/fixtures/api/rules_for_domain.yml
|
166
158
|
- test/fixtures/api/rules_for_domain_by_component.yml
|
167
159
|
- test/fixtures/api/save_group.yml
|
160
|
+
- test/fixtures/api/test_domain.yml
|
168
161
|
- test/fixtures/api/update_account_properties.yml
|
169
162
|
- test/fixtures/api/update_accounts_group_scope.yml
|
170
163
|
- test/fixtures/api/update_accounts_properties_scope.yml
|