zaig 1.0.10 → 1.0.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34c167ec0df18b273efccaa3a917a0295d32d7fc898a3f8787bc7af20616d142
4
- data.tar.gz: b8825e48c786235fc7168bea2f5d4b43cb551e81b63cc5e5851b857b8b0cc2f6
3
+ metadata.gz: '03094fa60fc889bb1771ce1e6ae0daf0e2df220d669fecdd9afac1bcc2de5991'
4
+ data.tar.gz: 61de42ec0c42be9c38469a7f9bec9b32b7cc5257d28cc8b912e0ea6e644ebcd3
5
5
  SHA512:
6
- metadata.gz: f2c1b0f6146ca518641e4021f209ba3c15946fc8d38b4a080eaec20b0fe852a28a50c03f0eebde5dffb7e81c2f06f934f89fa4857b0dca156c4af4c11ab2fd58
7
- data.tar.gz: a35126e8b604ebba65e084aa44f6805fdcbe999b53d33599a77d28f8d6dfaaa425f52b360b86389c96fa67d01b4e3ae3c430393b7ba427d3c26d78a857f6e7a8
6
+ metadata.gz: 751ae73d08258541b3d1d98b82f0730d113c80c6c81b26121318a446a9f914457a4cf1b4d0f224e010359fca221255cc5d7d6195716ec2fd77f61e92ac553682
7
+ data.tar.gz: 5547939be36e3dbda4f8a366486f9e1a305875733e362e9e70c4c641dee5e7ed714d39e4e0336abb3191ffab232c8d9a95e3ecc435cbef1bb35dae2da67ddd72
@@ -3,9 +3,10 @@
3
3
  module Zaig
4
4
  # Class to instance a authenticated connection object.
5
5
  class Connection < Flash::Integration::Connection
6
+ JWT_EXP_TIME = DateTime.now.next_day(1).to_time.to_i.freeze
7
+
6
8
  def initialize(request_class: Faraday, base_url: Zaig.configuration.base_url)
7
9
  @jwt_algorithm = Zaig.configuration.jwt_algorithm
8
- @jwt_exp_time = Zaig.configuration.jwt_exp_time
9
10
  @jwt_secret = Zaig.configuration.jwt_secret
10
11
  @jwt_user = Zaig.configuration.jwt_user
11
12
 
@@ -26,7 +27,7 @@ module Zaig
26
27
 
27
28
  private
28
29
  def access_token
29
- JWT.encode({ exp: @jwt_exp_time, user: @jwt_user }, @jwt_secret, @jwt_algorithm)
30
+ JWT.encode({ exp: JWT_EXP_TIME, user: @jwt_user }, @jwt_secret, @jwt_algorithm)
30
31
  end
31
32
  end
32
33
  end
data/lib/zaig/version.rb CHANGED
@@ -8,5 +8,5 @@ module Zaig
8
8
  # Major - Incremented for incompatible changes with previous release (or big enough new features)
9
9
  # Minor - Incremented for new backwards-compatible features + deprecations
10
10
  # Patch - Incremented for backwards-compatible bug fixes
11
- VERSION = "1.0.10"
11
+ VERSION = "1.0.11"
12
12
  end
data/lib/zaig.rb CHANGED
@@ -49,16 +49,12 @@ module Zaig
49
49
  # Basic configuration settings
50
50
  class Configuration
51
51
  attr_accessor :base_url, :jwt_secret, :jwt_user
52
- attr_writer :jwt_algorithm, :jwt_exp_time, :registration_endpoint
52
+ attr_writer :jwt_algorithm, :registration_endpoint
53
53
 
54
54
  def jwt_algorithm
55
55
  @jwt_algorithm ||= "HS256"
56
56
  end
57
57
 
58
- def jwt_exp_time
59
- @jwt_exp_time ||= 1_658_439_475
60
- end
61
-
62
58
  def registration_endpoint
63
59
  @registration_endpoint ||= "zaig/consulta_de_credito"
64
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaig
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danilo Carolino