autodiscover 1.0.1 → 1.0.2
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 +4 -4
- data/.travis.yml +6 -2
- data/README.md +3 -0
- data/autodiscover.gemspec +1 -0
- data/lib/autodiscover/client.rb +3 -2
- data/lib/autodiscover/pox_request.rb +1 -1
- data/lib/autodiscover/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27456985a67e136bd990830cbd74707cda82a2a1
|
4
|
+
data.tar.gz: bcaff404de4395a19995cc609c736b8f2c36dd00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab42f7d08a28a45f118fb00247bc21cb44032fdf8ed3b833124fcf1cda249408dd88f5024af94a2715ff69407788f9d92bff1f4319897e79e1c508af071573bd
|
7
|
+
data.tar.gz: 6244776c25972cc095a749f7c67d7b38b1295478e02dc49852dae544b71a609f94ebce8167162d1b454acdeda3d53a7b19bf3e7bd4ed3b48f1ac3c8daea1b4f4
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -53,6 +53,9 @@ client = Autodiscover::Client.new(email: "blumbergh@initech.local", password: "t
|
|
53
53
|
# Override the domain
|
54
54
|
client = Autodiscover::Client.new(email: "blumbergh@initech.local", password: "tps_eq_awesome", domain: "tpsreports.local")
|
55
55
|
|
56
|
+
# Set a custom connection timeout
|
57
|
+
client = Autodiscover::Client.new(email: "blumbergh@initech.local", password: "tps_eq_awesome", connect_timeout: 5)
|
58
|
+
|
56
59
|
# Ignore SSL Errors
|
57
60
|
client.autodiscover(ignore_ssl_errors: true)
|
58
61
|
```
|
data/autodiscover.gemspec
CHANGED
@@ -6,6 +6,7 @@ require 'autodiscover/version'
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = 'autodiscover'
|
8
8
|
s.version = Autodiscover::VERSION
|
9
|
+
s.license = 'MIT'
|
9
10
|
s.summary = "Ruby client for Microsoft's Autodiscover Service"
|
10
11
|
s.description = "The Autodiscover Service provides information about a Microsoft Exchange environment such as service URLs, versions and many other attributes."
|
11
12
|
s.required_ruby_version = '>= 2.1.0'
|
data/lib/autodiscover/client.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Autodiscover
|
2
2
|
class Client
|
3
|
-
|
3
|
+
DEFAULT_HTTP_TIMEOUT = 10
|
4
4
|
attr_reader :domain, :email, :http
|
5
5
|
|
6
6
|
# @param email [String] An e-mail to use for autodiscovery. It will be
|
@@ -10,10 +10,11 @@ module Autodiscover
|
|
10
10
|
# with something other than the e-mail. For instance DOMAIN\user
|
11
11
|
# @param domain [String] An optional domain to provide as an override for
|
12
12
|
# the one parsed from the e-mail.
|
13
|
-
def initialize(email:, password:, username: nil, domain: nil)
|
13
|
+
def initialize(email:, password:, username: nil, domain: nil, connect_timeout: DEFAULT_HTTP_TIMEOUT)
|
14
14
|
@email = email
|
15
15
|
@domain = domain || @email.split("@").last
|
16
16
|
@http = HTTPClient.new
|
17
|
+
@http.connect_timeout = connect_timeout if connect_timeout
|
17
18
|
@username = username || email
|
18
19
|
@http.set_auth(nil, @username, password)
|
19
20
|
end
|
@@ -19,7 +19,7 @@ module Autodiscover
|
|
19
19
|
begin
|
20
20
|
response = client.http.post(url, request_body, {'Content-Type' => 'text/xml; charset=utf-8'})
|
21
21
|
return PoxResponse.new(response.body) if good_response?(response)
|
22
|
-
rescue Errno::ENETUNREACH, Errno::ECONNREFUSED
|
22
|
+
rescue Errno::ENETUNREACH, Errno::ECONNREFUSED, HTTPClient::ConnectTimeoutError
|
23
23
|
next
|
24
24
|
rescue OpenSSL::SSL::SSLError
|
25
25
|
options[:ignore_ssl_errors] ? next : raise
|
data/lib/autodiscover/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autodiscover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David King
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-10-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -169,7 +169,8 @@ files:
|
|
169
169
|
- test/units/pox_response_test.rb
|
170
170
|
- test/units/server_version_parser_test.rb
|
171
171
|
homepage: http://github.com/WinRb/autodiscover
|
172
|
-
licenses:
|
172
|
+
licenses:
|
173
|
+
- MIT
|
173
174
|
metadata: {}
|
174
175
|
post_install_message:
|
175
176
|
rdoc_options: []
|