omniauth-krystal 1.3.0 → 1.5.0

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: ff1b48f554292417ddac46a620f11567455881410467ab639f74fa5eb87e2628
4
- data.tar.gz: 0dfc2595766ef70626614953fcd08539dbe594e457ed5fcdc8efb336f5f1fce9
3
+ metadata.gz: c90fb431fe32e4ab575e637d96209631d6c76f52760a3e358ab81d0f59fb6c93
4
+ data.tar.gz: f6dcc39bd7e7d9b0be570693fbcff5d188eca826c975faa79e04d1ee3184afb3
5
5
  SHA512:
6
- metadata.gz: 95ed948cb99326e1b8917b06ce87d25133570d1162206eac4310975e7271b033f7b4e7a734a86a6a9949d2e06737e84c77b14fc841ea58f76a5bc703e509d1b8
7
- data.tar.gz: 2970ce91eaa7e31c94a877f734fe5413ad21b1f5166c7c3628b7a1b0489315088c776b50e6b3fd0bf367db7928fa1ea63d58521661567954fdfa195bedfe5106
6
+ metadata.gz: aa4c4e05ce103e63c144798b63ecbdefc6162200e5249d57aea2f07c45d74a3124a7ce084c166833033a3a927410ea727948eaff2e2f87f004b2944706cbff50
7
+ data.tar.gz: 260dc2fda6587ad42f9e8b7155cae2834cd1ae3b86878334b7719d3a92af1565bce8e56a3df353144b414e5292efb70e62aa5fbcff1010d357d42eda04b65509
@@ -18,12 +18,14 @@ module OmniAuth
18
18
  class AntiReplayTokenAlreadyUsedError < Error
19
19
  end
20
20
 
21
+ JWT_RESERVED_CLAIMS = %w[ar exp nbf iss aud jti iat sub].freeze
22
+
21
23
  def initialize(app, options = {})
22
24
  @app = app
23
25
  @options = options
24
26
 
25
27
  @options[:provider_name] ||= 'krystal'
26
- @options[:identity_url] ||= ENV.fetch('KRYSTAL_IDENTITY_URL', 'https://identity.k.io')
28
+ @options[:identity_url] ||= ENV.fetch('KRYSTAL_IDENTITY_URL', 'https://identity.krystal.io')
27
29
  @options[:anti_replay_expiry_seconds] ||= 60
28
30
 
29
31
  @keys = SigningKeys.new("#{@options[:identity_url]}/.well-known/signing.json")
@@ -66,6 +68,9 @@ module OmniAuth
66
68
  # thinks the session is trusted as normal.
67
69
  env['rack.session']['omniauth.state'] = state
68
70
 
71
+ # Set any additional params that were passed in the state.
72
+ env['rack.session']['omniauth.params'] = data.reject { |key| JWT_RESERVED_CLAIMS.include?(key) }
73
+
69
74
  @app.call(env)
70
75
  end
71
76
  # rubocop:enable Metrics/AbcSize
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Krystal
5
- VERSION = '1.3.0'
5
+ VERSION = '1.5.0'
6
6
  end
7
7
  end
@@ -8,7 +8,7 @@ module OmniAuth
8
8
  option :name, 'krystal'
9
9
 
10
10
  option :client_options,
11
- url: ENV.fetch('KRYSTAL_IDENTITY_URL', 'https://identity.k.io'),
11
+ url: ENV.fetch('KRYSTAL_IDENTITY_URL', 'https://identity.krystal.io'),
12
12
  site: ENV.fetch('KRYSTAL_IDENTITY_API_URL', nil),
13
13
  authorize_url: ENV.fetch('KRYSTAL_IDENTITY_OAUTH_AUTHORIZE_URL', nil),
14
14
  token_url: ENV.fetch('KRYSTAL_IDENTITY_OAUTH_TOKEN_URL', nil)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-krystal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-29 00:00:00.000000000 Z
11
+ date: 2023-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json