leaseweb-rest-api 1.1.2 → 1.1.3

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: a3367557a3d75e9e48b611e83de1dfd476f8aba1
4
- data.tar.gz: 10ac30331b52b00aa9c3219648b5c46972138cf5
3
+ metadata.gz: 7d1dc51e864d30b49c856ed7a4c4b039dd941907
4
+ data.tar.gz: 9f36f39ff7b4db041290b27308f6b74eac77863d
5
5
  SHA512:
6
- metadata.gz: fd89e031b50a353211b5e5b48f6d490b032d8da3937e36059a6b76d017127732afc9e152e0408cf75a867789760ad4a3b072b3c7ed89aa25b9bcfc9e792f82f4
7
- data.tar.gz: 8173ee01c443ac43074eb45d1c8d3e7d0797a25d38e33d07ee729b4e4689a3fbab3264b7137e975e2b1d1335804cf90f825b32b3d9949c2747495f4a5c02f070
6
+ metadata.gz: 343ad233ac49edb30986a599c31f263c92a564eba73c2b667327bdd99f1fed9b255e350c8300bb60f69a590058cb4ab1eb3fdecca8c6508c552aed9795627acf
7
+ data.tar.gz: 4ff4fb368ff4d31a78631b5a25a2f8ee903f2b5191c4931db2b4227412ef66fdb610f8771db7cdb42970e7935160139f0b8c232de0a76b703968452cf4c45060
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'leaseweb-rest-api'
3
- s.version = '1.1.2'
3
+ s.version = '1.1.3'
4
4
  s.authors = 'Arnoud Vermeer'
5
5
  s.email = 'a.vermeer@tech.leaseweb.com'
6
6
  s.license = 'Apache'
@@ -24,6 +24,13 @@ class LeasewebAPI
24
24
  @options = { headers: { 'Authorization' => "Bearer #{access_token}" } }
25
25
  end
26
26
 
27
+ def getPasswordToken(username, password, client_id, client_secret)
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
+ access_token = response.parsed_response['access_token']
30
+
31
+ @options = { headers: { 'Authorization' => "Bearer #{access_token}" } }
32
+ end
33
+
27
34
  def readPrivateKey(privateKey, password)
28
35
  @private_key = OpenSSL::PKey::RSA.new(File.read(privateKey), password)
29
36
  end
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.2
4
+ version: 1.1.3
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-01-30 00:00:00.000000000 Z
11
+ date: 2017-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  requirements: []
91
91
  rubyforge_project:
92
- rubygems_version: 2.4.5.1
92
+ rubygems_version: 2.6.8
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: Leaseweb REST API client for Ruby