brl_auth 0.1.0 → 0.1.0.1

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: bd354f62a92d35682bdafa06eebf3ae5995dca34b53aed0e21154a6c5e754fbd
4
- data.tar.gz: 7790bdf84e4a7efae9d15eace2464cb69b7e56f9dcce2d1ace7a3ab152156f91
3
+ metadata.gz: dd1eb2fa32a8d6956353d7c8d7224b9fbb18670939c80cf290ea404d88a27cf9
4
+ data.tar.gz: f5bd2726f40a25de222b27775d11dd551b40776c658faba7048500b1731bae6e
5
5
  SHA512:
6
- metadata.gz: 5c989bfb885e1f24376b54014fdab445ef1e18dfbeff725783ab2d50e5324d4852c5870f5ac82a38a05299e6bcfe11ba6f6b8e5cc0dbc1a2e031001e6730c85b
7
- data.tar.gz: 3d22b1bfadb636b35167c133a07fb0324f7f1ad34199391515b042e1a659ee38a7e1cf6b39bc73c7272027475a404a7d8f8291baa2ce3cb2c499041138bb2cab
6
+ metadata.gz: dd965e7556d88b91a0fbf4d7a807ea38a8a88eae0fcda259e36ae6de55a2a6856e6586eb75b8b071ea5dd37fb753ec36db3b2b148fa1f4594ab67eb4d8761d85
7
+ data.tar.gz: f5d47b36ad8fab43143e4e65b0bd9c1c042f8c22818caae291dc49504f5a45bed9584154e84c832a0cbe59a1f394ba20f51b5cfb24a0da224e3bc6cca8fe0e7f
data/README.md CHANGED
@@ -30,6 +30,7 @@ Create the config/initializers/brl.rb file and define:
30
30
  ```ruby
31
31
  # Set the env variables
32
32
  BRL.configure do |config|
33
+ config.auth_url_value = "https://xxx.hmra.com.br" # optional; default: https://hom.api.acesso.hmra.com.br
33
34
  config.handshake = "XXXXXX-XXXXX-XXXX"
34
35
  config.secret_key = "xxxxxxxxx"
35
36
  end
@@ -6,7 +6,7 @@ module BRL
6
6
  ACCEPT = "application/json"
7
7
  CONTENT_TYPE = "application/x-www-form-urlencoded"
8
8
 
9
- def initialize(request_class: Faraday, base_url: BRL::Auth::BASE_URL)
9
+ def initialize(request_class: Faraday, base_url: BRL.configuration.auth_base_url)
10
10
  super(request_class: request_class, base_url: base_url)
11
11
  end
12
12
 
@@ -9,6 +9,6 @@ module BRL
9
9
  # Major - Incremented for incompatible changes with previous release (or big enough new features)
10
10
  # Minor - Incremented for new backwards-compatible features + deprecations
11
11
  # Patch - Incremented for backwards-compatible bug fixes
12
- VERSION = "0.1.0"
12
+ VERSION = "0.1.0.1"
13
13
  end
14
14
  end
data/lib/brl_auth.rb CHANGED
@@ -44,7 +44,7 @@ module BRL
44
44
  attr_writer :auth_base_url, :handshake, :secret_key
45
45
 
46
46
  def auth_base_url
47
- @auth_base_url ||= ENV["BRL_AUTH_BASE_URL"]
47
+ @auth_base_url ||= BRL::Auth::BASE_URL
48
48
  end
49
49
 
50
50
  def handshake
@@ -50,7 +50,7 @@ RSpec.describe BRL::Auth do
50
50
  context "when configuration is not defined" do
51
51
  it { expect(subject).not_to be_nil }
52
52
 
53
- it { expect(subject.auth_base_url).to be_nil }
53
+ it { expect(subject.auth_base_url).to eq(described_class::BASE_URL) }
54
54
 
55
55
  it { expect(subject.handshake).to be_nil }
56
56
 
@@ -59,14 +59,13 @@ RSpec.describe BRL::Auth do
59
59
 
60
60
  context "when its configured by envs" do
61
61
  before do
62
- ENV["BRL_AUTH_BASE_URL"] = "auth_url_value"
63
62
  ENV["BRL_HANDSHAKE"] = "handshake_value"
64
63
  ENV["BRL_SECRET_KEY"] = "password_value"
65
64
  end
66
65
 
67
66
  it { expect(subject).not_to be_nil }
68
67
 
69
- it { expect(subject.auth_base_url).to eq("auth_url_value") }
68
+ it { expect(subject.auth_base_url).to eq(described_class::BASE_URL) }
70
69
 
71
70
  it { expect(subject.handshake).to eq("handshake_value") }
72
71
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brl_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danilo Carolino
@@ -241,7 +241,6 @@ files:
241
241
  - LICENSE.txt
242
242
  - README.md
243
243
  - Rakefile
244
- - lib/brl/auth/BRL.configure do |config|.arb
245
244
  - lib/brl/auth/authenticated_connection.rb
246
245
  - lib/brl/auth/authenticated_resource.rb
247
246
  - lib/brl/auth/authentication_error.rb
@@ -1,4 +0,0 @@
1
- BRL.configure do |config|
2
- config.handshake = "D317F1AA-8D36-468F-9"
3
- config.secret_key = "f89f8d0e735a91c5269ab08d72fa27670d000e7561698d6e664e7b603f5c4e40"
4
- end