haveapi-client 0.23.4 → 0.23.5

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
  SHA256:
3
- metadata.gz: fd26bebd363a75f1ada6697b45bc19f44e55101f1ec68c2d2ff1d31c9f127098
4
- data.tar.gz: e36f4dc6fc1fdbec540b8cb2272a02e6fdecb18244e2fa4711a800ed08ea275e
3
+ metadata.gz: 7d50d025c1b475f639ceb4503bf5030bf0d97cd96e03f34f2d48c0fdb592646d
4
+ data.tar.gz: d4cfc1d470c048fccfd41a9d02d20250dedf4b7e5c6f856d7e47b2d06d5656bf
5
5
  SHA512:
6
- metadata.gz: 8f7924fc4391b6482a2439a4fccdcd60eb06c926ec1dd2f475e0bc12154d2cda5954a5adbc468ea168d528fff452085c3914999da5cc9c27de10dc491da4956c
7
- data.tar.gz: 1e1d637f3e200ccf87a6feb34f8971658079e027f9f9b1abbd4d9e846dadffbf7817ac5f167f191c4858374634be1b8b0082bfa4bf653ac54ed32c9b17b6d4a4
6
+ metadata.gz: ed4c03e9dad72f24eb388f33e37f58bfa0359603721056a7cad4341a184b22ffc8b401ad8e1918e4244790f236399694c0dd09c083f2051d9bdf66660fe6ef38
7
+ data.tar.gz: 2b37aa2e6172253b62fce09bca20881a3a11e8c2bc55e09774a8c0a247461fa9188dd8b17355256c91b4d9bcb086efe1fb0cda2defc24d66cd1fb3dd0bf9e4b1
@@ -73,11 +73,6 @@ module HaveAPI::Client
73
73
  def save
74
74
  @opts
75
75
  end
76
-
77
- # Load auth provider attributes from previous #save call.
78
- def load(hash)
79
- @opts = hash
80
- end
81
76
  end
82
77
  end
83
78
  end
@@ -8,7 +8,14 @@ module HaveAPI::Client::Authentication
8
8
  def setup
9
9
  @via = @opts[:via] || :header
10
10
  @token = @opts[:token]
11
- @valid_to = @opts[:valid_to]
11
+
12
+ @valid_to =
13
+ case @opts[:valid_to]
14
+ when Time # usually given at runtime
15
+ @opts[:valid_to]
16
+ when Integer # loaded from config
17
+ Time.at(@opts[:valid_to])
18
+ end
12
19
 
13
20
  request_token unless @token
14
21
 
@@ -30,12 +37,7 @@ module HaveAPI::Client::Authentication
30
37
  end
31
38
 
32
39
  def save
33
- { token: @token, valid_to: @valid_to }
34
- end
35
-
36
- def load(hash)
37
- @token = hash[:token]
38
- @valid_to = hash[:valid_to]
40
+ { token: @token, valid_to: @valid_to && @valid_to.to_i }
39
41
  end
40
42
 
41
43
  def renew
@@ -1,6 +1,6 @@
1
1
  module HaveAPI
2
2
  module Client
3
3
  PROTOCOL_VERSION = '2.0'.freeze
4
- VERSION = '0.23.4'.freeze
4
+ VERSION = '0.23.5'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haveapi-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.4
4
+ version: 0.23.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Skokan