leaseweb-rest-api 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d1dc51e864d30b49c856ed7a4c4b039dd941907
4
- data.tar.gz: 9f36f39ff7b4db041290b27308f6b74eac77863d
3
+ metadata.gz: 7ecc51f07cf45f19053de3fd9cf08410e955cf50
4
+ data.tar.gz: 44c1862d16410624b02560c2f1278d85a79ae916
5
5
  SHA512:
6
- metadata.gz: 343ad233ac49edb30986a599c31f263c92a564eba73c2b667327bdd99f1fed9b255e350c8300bb60f69a590058cb4ab1eb3fdecca8c6508c552aed9795627acf
7
- data.tar.gz: 4ff4fb368ff4d31a78631b5a25a2f8ee903f2b5191c4931db2b4227412ef66fdb610f8771db7cdb42970e7935160139f0b8c232de0a76b703968452cf4c45060
6
+ metadata.gz: b0294824019a175a512b657fdc38d5b8f656a1cd9dec950d37244f858cead8082924ce1d9b8dbd74982cce5f598454535b6513447ac21b1097693bc0fafd05f9
7
+ data.tar.gz: 5d9f49e10b03721c891b8de40ae8f263e919923e3e05fa936d04576abf59f8b92dd907525c103d2b4b7051280f877c83cc884b559f085fd315ce56c9b29986e0
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'gemspec'
3
+ gemspec
4
+
4
5
  gem 'rake'
6
+ gem 'rake-rspec'
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ require 'rake/rspec'
2
+
3
+ task default: :spec
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'leaseweb-rest-api'
3
- s.version = '1.1.3'
3
+ s.version = '1.1.4'
4
4
  s.authors = 'Arnoud Vermeer'
5
5
  s.email = 'a.vermeer@tech.leaseweb.com'
6
6
  s.license = 'Apache'
@@ -14,21 +14,21 @@ class LeasewebAPI
14
14
  base_uri 'https://api.leaseweb.com'
15
15
 
16
16
  def apiKeyAuth(apikey)
17
- @options = { headers: { 'X-Lsw-Auth' => apikey } }
17
+ @options = { headers: { 'X-Lsw-Auth' => apikey, 'Content-Type' => 'application/json' } }
18
18
  end
19
19
 
20
20
  def getOauthToken(clientId, clientSecret)
21
21
  response = self.class.post('https://auth.leaseweb.com/token', basic_auth: { username: clientId, password: clientSecret }, body: { grant_type: 'client_credentials' })
22
22
  access_token = response.parsed_response['access_token']
23
23
 
24
- @options = { headers: { 'Authorization' => "Bearer #{access_token}" } }
24
+ @options = { headers: { 'Authorization' => "Bearer #{access_token}", 'Content-Type' => 'application/json' } }
25
25
  end
26
26
 
27
27
  def getPasswordToken(username, password, client_id, client_secret)
28
28
  response = self.class.post('https://auth.leaseweb.com/token', basic_auth: { username: client_id, password: client_secret }, body: { grant_type: 'password', username: username, password: password })
29
29
  access_token = response.parsed_response['access_token']
30
30
 
31
- @options = { headers: { 'Authorization' => "Bearer #{access_token}" } }
31
+ @options = { headers: { 'Authorization' => "Bearer #{access_token}", 'Content-Type' => 'application/json' } }
32
32
  end
33
33
 
34
34
  def readPrivateKey(privateKey, password)
@@ -3,13 +3,18 @@ require_relative '../../lib/leaseweb-rest-api'
3
3
 
4
4
  describe LeasewebAPI do
5
5
  let(:apikey) { 'e17b534d-3af6-4208-89e6-e43798b3c30f' }
6
- let(:privateKey) { '/Users/a.vermeer/Documents/leaseweb-rest-api/id_rsa' }
6
+ let(:privateKey) { File.expand_path('./test/id_rsa') }
7
7
  let(:password) { 'cdcHRt+,zVuZWtV2a7PkixZTn' }
8
8
  let(:request_headers) do
9
9
  { 'X-Lsw-Auth' => apikey }
10
10
  end
11
11
 
12
- subject { LeasewebAPI.new(apikey, privateKey, password) }
12
+ subject do
13
+ api = LeasewebAPI.new
14
+ api.apiKeyAuth(apikey)
15
+ api.readPrivateKey(privateKey, password)
16
+ api
17
+ end
13
18
 
14
19
  describe '#getDomains' do
15
20
  let(:response) { '{}' }
data/test/id_rsa ADDED
@@ -0,0 +1,54 @@
1
+ -----BEGI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Fa1lsCjq1RZOoleWdECAwEAAQ==
14
+ -----END PUBLIC KEY-----
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leaseweb-rest-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnoud Vermeer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-23 00:00:00.000000000 Z
11
+ date: 2017-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -63,12 +63,15 @@ files:
63
63
  - ".rubocop.yml"
64
64
  - Gemfile
65
65
  - LICENSE.txt
66
+ - Rakefile
66
67
  - leaseweb-rest-api.gemspec
67
68
  - lib/hash-to-uri-conversion.rb
68
69
  - lib/leaseweb-rest-api.rb
69
70
  - readme.md
70
71
  - spec/lib/leaseweb-rest-api_spec.rb
71
72
  - spec/spec_helper.rb
73
+ - test/id_rsa
74
+ - test/id_rsa.pub.pem
72
75
  homepage: https://github.com/LeaseWeb/leaseweb-rest-api
73
76
  licenses:
74
77
  - Apache
@@ -89,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
92
  version: '0'
90
93
  requirements: []
91
94
  rubyforge_project:
92
- rubygems_version: 2.6.8
95
+ rubygems_version: 2.6.11
93
96
  signing_key:
94
97
  specification_version: 4
95
98
  summary: Leaseweb REST API client for Ruby