usps-jwt_auth 0.2.1 → 0.2.4.pre.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: 357bab1e1b2d7160faaae475b6666bf78d2c835b90dd7c9ee5009b4c9d67cc68
4
- data.tar.gz: 49a97cfb8e6dfc729f8e2221779ca9e7c541057e9bf260a49dbb7138ea75619f
3
+ metadata.gz: f86b88ea077b3879e241b5299b1d5aa694c45c0aaa35db253c3a5c2d7b0f48ea
4
+ data.tar.gz: dafe92a708012acd5fbe542939fde3fc038a08c01716525f8672125c67cf83d9
5
5
  SHA512:
6
- metadata.gz: ad26fdabdfbbc6047875936cb9b2735c0e0bcbbc63fbab9588c052bc21d0b0c87165630f664be7f39c2d792ec3c8ae2c4016e3b27356f0ba9cc67a1b14016dd0
7
- data.tar.gz: 56f6cfd1f4e7f4912c1993cced316c32278a41cc393e2cc2111fdcb1446fc19ee52786f56071b0ac96895fcece4c192f42c6c8bee0cfa94f1de0e4ec7c376b96
6
+ metadata.gz: d4e03a9aa9ba476923a8e59128abf1c888ed282fff161f3a32aa1b06a6275ec6e0bffc6c03c60ee1dafbfc74fd31920a692a2da5b93743d547138d3651ef8dff
7
+ data.tar.gz: 0d26ebb2f9333d203538f2933f98d8aaf9249f42812f268ee42a34a52249710184dc662fedab977d5112db266b492453b1afe268c610e6167bfec892b4d0de0e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- usps-jwt_auth (0.2.1)
4
+ usps-jwt_auth (0.2.4.pre.1)
5
5
  activesupport (~> 8.0)
6
6
  fileutils (~> 1.7)
7
7
  jwt (~> 3.1)
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  Add the gem to your Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'usps-jwt_auth', '>= 0.1.0'
10
+ gem 'usps-jwt_auth', '>= 0.2.3'
11
11
  ```
12
12
 
13
13
  Then run the install task:
@@ -95,15 +95,15 @@ module Usps
95
95
  def jwt
96
96
  Decode.decode(
97
97
  fetch_jwt,
98
- audience: [JwtAuth.config.jwt.audience],
99
- issuer: JwtAuth.config.jwt.issuer
98
+ audience: [JwtAuth.config.audience],
99
+ issuer: Regexp.union(JwtAuth.config.issuers)
100
100
  )
101
101
  end
102
102
 
103
103
  def redirect_to_login
104
104
  url = 'https://www.usps.org/jwt'
105
105
  local = "#{url}?local&port=#{ENV.fetch('PORT', '3000')}"
106
- production = "#{url}?application=#{JwtAuth.config.jwt.audience}"
106
+ production = "#{url}?application=#{JwtAuth.config.audience}"
107
107
  url = JwtAuth.config.environment.development? ? local : production
108
108
  url = "#{url}&path=#{request.path}"
109
109
 
@@ -116,7 +116,7 @@ module Usps
116
116
  store_jwt(
117
117
  Encode.encode(
118
118
  { certificate: ENV['STUB_CERTIFICATE'].presence || 'E123456' },
119
- audience: [JwtAuth.config.jwt.audience], issuer: JwtAuth.config.jwt.issuers.first
119
+ audience: [JwtAuth.config.audience], issuer: JwtAuth.config.issuers.first
120
120
  )
121
121
  )
122
122
  end
@@ -31,10 +31,6 @@ module Usps
31
31
  @public_keys_path = path.is_a?(Pathname) ? path : Pathname.new(path)
32
32
  end
33
33
 
34
- def issuer
35
- /\A#{issuer_base}(?::#{Regexp.union(issuers)})?\z/
36
- end
37
-
38
34
  def validate!
39
35
  missing_required_options = REQUIRED_OPTIONS.select { public_send(it).nil? }
40
36
  return unless missing_required_options.any?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module JwtAuth
5
- VERSION = '0.2.1'
5
+ VERSION = '0.2.4-1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usps-jwt_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.4.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander