adp-connection 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/adp/api_connection.rb +7 -0
- data/lib/adp/connection/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a21fd0beca709c7b667d18e3db8f615d204905f0
|
4
|
+
data.tar.gz: 22575af05a9c8fd1cec5fb8db55b11e0e39f05c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5121ee7ca6838a5f1cc0070be3bc0da639a08f03268ef0080c0e7490c62a89b81e3d9345e16c493878bee5b86fabf44919877ecef946f2815143e1d0a64c6172
|
7
|
+
data.tar.gz: e3f1fb3a4431dc6c9a84d4eb2f307b2f1323e2afacdcba3c8b86911ae81d61385e3199950e2c44da9f9080b5cedbed6d433219e871454facdb810163e22a782f
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
The ADP Client Connection Library is intended to simplify and aid the process of authenticating, authorizing and connecting to the ADP Marketplace API Gateway. The Library includes a sample application that can be run out-of-the-box to connect to the ADP Marketplace API **test** gateway.
|
4
4
|
|
5
5
|
### Version
|
6
|
-
1.
|
6
|
+
0.1.3 (Beta)
|
7
7
|
|
8
8
|
|
9
9
|
## Installation
|
data/lib/adp/api_connection.rb
CHANGED
@@ -9,6 +9,7 @@ require_relative "connection_exception"
|
|
9
9
|
require_relative "api_connection"
|
10
10
|
require_relative "client_credential_configuration"
|
11
11
|
require_relative "authorization_code_configuration"
|
12
|
+
require_relative "connection/version"
|
12
13
|
|
13
14
|
module Adp
|
14
15
|
module Connection
|
@@ -125,10 +126,14 @@ module Adp
|
|
125
126
|
log.debug("Client Secret: #{data["client_secret"]}")
|
126
127
|
log.debug("Grant Type: #{data["grant_type"]}")
|
127
128
|
|
129
|
+
useragent = "adp-connection-ruby/#{Adp::Connection::VERSION}"
|
128
130
|
uri = URI.parse( url );
|
129
131
|
pem = File.read("#{self.connection_configuration.sslCertPath}");
|
130
132
|
key = File.read(self.connection_configuration.sslKeyPath);
|
131
133
|
http = Net::HTTP.new(uri.host, uri.port);
|
134
|
+
|
135
|
+
log.debug("User agent: #{useragent}")
|
136
|
+
|
132
137
|
if (!self.connection_configuration.sslCertPath.nil?)
|
133
138
|
http.use_ssl = true
|
134
139
|
http.cert = OpenSSL::X509::Certificate.new( pem );
|
@@ -143,6 +148,8 @@ module Adp
|
|
143
148
|
request = Net::HTTP::Get.new(uri.request_uri)
|
144
149
|
end
|
145
150
|
|
151
|
+
request.initialize_http_header({"User-Agent" => useragent })
|
152
|
+
|
146
153
|
request["Content-Type"] = content_type
|
147
154
|
|
148
155
|
# add credentials if available
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adp-connection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Napier, Junior (CORP)
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|