mxhero-api 0.1.23 → 0.1.24

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjA2M2I2OTM1ZjljNWM0ZTQ0Mjk5ZGQzN2JlM2IwZjI0M2ZlZmVmMA==
4
+ ZjNmYmVlYjc4MDk3NDRmMjRhNWRlM2RmYjNjOTJjM2M4MDI2NTJhMA==
5
5
  data.tar.gz: !binary |-
6
- M2ViZWM4NWVlN2M1YTg0Yzg4NGVhNTBiZTBkOGRhZjQzMjE5YjRhMA==
6
+ YTFiMWUwOTcwZTAwYTQ2OTEyYjA0Mzk1MDk0MzE4M2RlMGFlMDFiMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- M2QzN2EzMWQxYmE0YzA2NTgzMWYzYmE3YWYwMDFlZGYxZmFhMjNjN2Y3ZjNi
10
- ZDVmMDE4MmFhMTdjYjI1MjhmNjYzMzM3NmRkZDgyMDg0ZTdmYmJlZWIzZjY1
11
- ZGViMmJlYjVhZTIwMjg1NjA5YWVlZjA5ZmEzMDY4OGM2NWZkMjc=
9
+ NjJiNzBlYzIzNjQzNmJjYTIwOTdhNzJkNjAxNDU2MDI2NTJjZWE0NTFkMTY2
10
+ ODBkZWVhOTZiYjU0YTkzMmM1OTA1YjA5ZTk5MDNkNGNlOGQ1NWM5MzQxZmFl
11
+ ODc2ZDA3NmQyOWJmMDM0ZDc3NDk0ZTdiZDg3MGUxNTQ1ZDU3N2Q=
12
12
  data.tar.gz: !binary |-
13
- OTEwY2EwYTk3NDU1YjdmMDgxYTNlZjNkNDU1YzU3M2IyNWI2OThlOWVlZGEy
14
- ZTQ3ZWE3MjAxOTkwMzdlODkxNmY2NTc2ZTcxN2EyMGNjMWExOGFkZjEzMjEy
15
- MWJlNGI2OTc4ZDBhN2NlMzQzN2Q1ZDFjN2JjZDYzNzJiZTIwYjE=
13
+ OTk0MjAxM2U5ZjdjNmExYTkwN2Y4NzgyODQ0MmYyZDQ4OTBiYTYzNjk0Y2Fi
14
+ ZTkxN2RiMmU0ZWM5YjgzNzBjOWE4MjA0OGYyMGM0MjYxMWUyNTQ3MjA5ZGZk
15
+ NThhOGZlMmQ5OGM4MGFkOTkxMmZmM2QxMGM3YTY4NGI3ZTRhYTI=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.23
1
+ 0.1.24
data/lib/directories.rb CHANGED
@@ -143,7 +143,7 @@ module MxHero::API
143
143
 
144
144
  # Delete the directory configuration
145
145
  #
146
- # @return [MxHero::API::Response] with content empty.
146
+ # @return [MxHero::API::Response] with empty content.
147
147
  # In case on error, may be one of the following:
148
148
  # + domain.ldap.not.found : Inexistent group
149
149
  def delete
@@ -151,6 +151,15 @@ module MxHero::API
151
151
  wrap_response_from response
152
152
  end
153
153
 
154
+ # Request to refresh the accounts information
155
+ #
156
+ # @return [MxHero::API::Response] with empty content.
157
+ # In case on error, may be one of the following:
158
+ # + domain.ldap.not.found : Inexistent group
159
+ def refresh
160
+ response = call(:post, directories_url + '/refresh', throw_exception: false)
161
+ wrap_response_from response
162
+ end
154
163
 
155
164
  # -------------------------------------------------------------------------
156
165
  private
data/mxhero-api.gemspec CHANGED
@@ -1,22 +1,22 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: mxhero-api 0.1.23 ruby lib
2
+ # stub: mxhero-api 0.1.24 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "mxhero-api"
6
- s.version = "0.1.23"
6
+ s.version = "0.1.24"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Maximiliano Dello Russo", "Juan Pablo Royo", "mxHero"]
10
- s.date = "2013-11-29"
10
+ s.date = "2013-12-10"
11
11
  s.description = "A gem to provide easy access to the API of MxHero platform (http://www.mxhero.com/)"
12
12
  s.email = ["maxidr@mxhero.com", "juanpablo.royo@gmail.com", "mxhero@mxhero.com"]
13
- s.files = [".gitignore", ".rvmrc", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "VERSION", "lib/communication.rb", "lib/directories.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_directory.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/delete_directory.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/fetch_directory.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_directory.yml", "test/fixtures/api/update_rule.yml", "test/helper.rb", "test/test_directories.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/directories.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_directory.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/delete_directory.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/fetch_directory.yml", "test/fixtures/api/ldap_info.yml", "test/fixtures/api/refresh_directory.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_directory.yml", "test/fixtures/api/update_rule.yml", "test/helper.rb", "test/test_directories.rb", "test/test_dto.rb", "test/test_groups.rb", "test/test_mxhero_api.rb", "test/test_mxhero_api_response.rb"]
14
14
  s.homepage = "http://github.com/mxhero/mxhero-api"
15
15
  s.licenses = ["GPL-3"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubygems_version = "2.1.9"
18
18
  s.summary = "A MxHero API client for ruby"
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_directory.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/delete_directory.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/fetch_directory.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_directory.yml", "test/fixtures/api/update_rule.yml", "test/helper.rb", "test/test_directories.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_directory.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/delete_directory.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/fetch_directory.yml", "test/fixtures/api/ldap_info.yml", "test/fixtures/api/refresh_directory.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_directory.yml", "test/fixtures/api/update_rule.yml", "test/helper.rb", "test/test_directories.rb", "test/test_dto.rb", "test/test_groups.rb", "test/test_mxhero_api.rb", "test/test_mxhero_api_response.rb"]
20
20
 
21
21
  if s.respond_to? :specification_version then
22
22
  s.specification_version = 4
@@ -21,7 +21,7 @@ http_interactions:
21
21
  headers:
22
22
  !binary "RGF0ZQ==":
23
23
  - !binary |-
24
- TW9uLCAxOCBOb3YgMjAxMyAyMTo0MzoxMCBHTVQ=
24
+ VHVlLCAxMCBEZWMgMjAxMyAxNToxMjo0NSBHTVQ=
25
25
  !binary "U2VydmVy":
26
26
  - !binary |-
27
27
  QXBhY2hlLzIuMi4xNCAoVWJ1bnR1KQ==
@@ -33,9 +33,9 @@ http_interactions:
33
33
  YXBwbGljYXRpb24vanNvbg==
34
34
  body:
35
35
  encoding: US-ASCII
36
- string: ! '{"domain":"test.com","directoryType":"gapps","addres":null,"port":null,"sslFlag":false,"user":"user","password":"password","filter":null,"base":null,"nextUpdate":1384810990000,"lastUpdate":null,"error":null,"overrideFlag":false,"dnAuthenticate":null,"properties":[]}'
36
+ string: ! '{"domain":"test.com","directoryType":"gapps","addres":null,"port":null,"sslFlag":false,"user":"user","password":"password","filter":null,"base":null,"nextUpdate":1386688365000,"lastUpdate":null,"error":null,"overrideFlag":false,"dnAuthenticate":null,"properties":[],"periodInHours":0}'
37
37
  http_version:
38
- recorded_at: Mon, 18 Nov 2013 21:43:10 GMT
38
+ recorded_at: Tue, 10 Dec 2013 15:12:45 GMT
39
39
  - request:
40
40
  method: post
41
41
  uri: http://admin:password@test.mxhero.com/webapi/api/v1/domains/test.com/adldap
@@ -57,7 +57,7 @@ http_interactions:
57
57
  headers:
58
58
  !binary "RGF0ZQ==":
59
59
  - !binary |-
60
- TW9uLCAxOCBOb3YgMjAxMyAyMTo0MzoxMCBHTVQ=
60
+ VHVlLCAxMCBEZWMgMjAxMyAxNToxMjo0NiBHTVQ=
61
61
  !binary "U2VydmVy":
62
62
  - !binary |-
63
63
  QXBhY2hlLzIuMi4xNCAoVWJ1bnR1KQ==
@@ -74,5 +74,5 @@ http_interactions:
74
74
  encoding: US-ASCII
75
75
  string: ! '{"status":500,"code":500,"developerMessage":"domain.ldap.already.exists","moreInfoUrl":"mailto:support@mxhero.com"}'
76
76
  http_version:
77
- recorded_at: Mon, 18 Nov 2013 21:43:10 GMT
77
+ recorded_at: Tue, 10 Dec 2013 15:12:46 GMT
78
78
  recorded_with: VCR 2.5.0
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://admin:password@test.mxhero.com/webapi/api/v1/domains/test.com/adldap/refresh
6
+ body:
7
+ encoding: ASCII-8BIT
8
+ string: !binary |-
9
+ dGhyb3dfZXhjZXB0aW9uPWZhbHNl
10
+ headers:
11
+ Accept:
12
+ - application/json
13
+ Content-Type:
14
+ - application/json
15
+ Authorization:
16
+ - Basic YWRtaW46cGFzc3dvcmQ=
17
+ response:
18
+ status:
19
+ code: 200
20
+ message: !binary |-
21
+ T0s=
22
+ headers:
23
+ !binary "RGF0ZQ==":
24
+ - !binary |-
25
+ VHVlLCAxMCBEZWMgMjAxMyAxNToxNDozNSBHTVQ=
26
+ !binary "U2VydmVy":
27
+ - !binary |-
28
+ QXBhY2hlLzIuMi4xNCAoVWJ1bnR1KQ==
29
+ !binary "Q29udGVudC1MZW5ndGg=":
30
+ - !binary |-
31
+ MA==
32
+ !binary "Q29udGVudC1UeXBl":
33
+ - !binary |-
34
+ dGV4dC9wbGFpbg==
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ''
38
+ http_version:
39
+ recorded_at: Tue, 10 Dec 2013 15:14:35 GMT
40
+ recorded_with: VCR 2.5.0
@@ -84,6 +84,13 @@ class DirectoriesTest < MiniTest::Unit::TestCase
84
84
  end
85
85
  end
86
86
 
87
+ def test_refresh
88
+ VCR.use_cassette('refresh_directory') do
89
+ refresh_response = @dirs.refresh
90
+ assert refresh_response.success?
91
+ end
92
+ end
93
+
87
94
  def test_updates_dates
88
95
  directory = MxHero::API::Directory.new
89
96
  directory.next_update = 1379949740000
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mxhero-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.23
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maximiliano Dello Russo
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-11-29 00:00:00.000000000 Z
13
+ date: 2013-12-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: vcr
@@ -98,6 +98,7 @@ files:
98
98
  - test/fixtures/api/domains.yml
99
99
  - test/fixtures/api/fetch_directory.yml
100
100
  - test/fixtures/api/ldap_info.yml
101
+ - test/fixtures/api/refresh_directory.yml
101
102
  - test/fixtures/api/remove_account_from_group_twice.yml
102
103
  - test/fixtures/api/remove_inexistente_account_from_group.yml
103
104
  - test/fixtures/api/rules_for_domain.yml
@@ -161,6 +162,7 @@ test_files:
161
162
  - test/fixtures/api/domains.yml
162
163
  - test/fixtures/api/fetch_directory.yml
163
164
  - test/fixtures/api/ldap_info.yml
165
+ - test/fixtures/api/refresh_directory.yml
164
166
  - test/fixtures/api/remove_account_from_group_twice.yml
165
167
  - test/fixtures/api/remove_inexistente_account_from_group.yml
166
168
  - test/fixtures/api/rules_for_domain.yml