stytch 10.16.0 → 10.17.0

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: e590a7107606ed357b176a1bad55094f96da9ecf8de14050acd5d2b35642984e
4
- data.tar.gz: b542fde0c5ec2017b290242b84ef113372dfbb2ccb48ba5cba03bb5fd93b6859
3
+ metadata.gz: 111462e345fe52ad3693fc599d4534832028d8e52c1626d159353060119c1b23
4
+ data.tar.gz: 1a1032562e9ed90a8f17f062a6c3ad3be7b9ea74133467c1a9a3f8e67e58427b
5
5
  SHA512:
6
- metadata.gz: 0ae4779d69df0c0bbdfe69195288fa5713d9a03b3f321e702d3ab518fb2ea0fe9eda47cd4bf67521c7a262aa8b1c44d3f239b2c88b4fc78517f9f347c55383f7
7
- data.tar.gz: 35f75144aae1a2ef8934b5cf74c22833df6ce8bd7d1cc2ad9199bfcfbdf545251e922eaf70248cb4dc6afd88689b463fdbe55af974d0dc96c8ddd465ed8b9c7b
6
+ metadata.gz: 5b1792dcf36aad3226ec09c1b850888939f67e3e6a00b2a353f6a2e3ecb56707ab8187a79baf1887922113dbd3dced62cd23805f6cdde22675f7a0d1e943c440
7
+ data.tar.gz: 0fb41b4b5477dcfed44254599be3b0fc33b8fc49f54c4a16c6aeb3a462e131f91a9670c8b4066168351c73732adc7ee35bc4ac32e0c5b4fee2ec85b4e36a047c
@@ -582,10 +582,13 @@ module StytchB2B
582
582
  max_token_age_seconds = 300 if max_token_age_seconds.nil?
583
583
  clock_tolerance_seconds = 0 if clock_tolerance_seconds.nil?
584
584
 
585
- issuer = 'stytch.com/' + @project_id
585
+ default_issuer = 'stytch.com/' + @project_id
586
+ base_url_issuer = @connection.api_host
587
+ valid_issuers = [default_issuer, base_url_issuer]
588
+
586
589
  begin
587
590
  decoded_token = JWT.decode session_jwt, nil, true,
588
- { jwks: @jwks_loader, iss: issuer, verify_iss: true, aud: @project_id, verify_aud: true, algorithms: ['RS256'], nbf_leeway: clock_tolerance_seconds }
591
+ { jwks: @jwks_loader, iss: valid_issuers, verify_iss: true, aud: @project_id, verify_aud: true, algorithms: ['RS256'], nbf_leeway: clock_tolerance_seconds }
589
592
 
590
593
  session = decoded_token[0]
591
594
  iat_time = Time.at(session['iat']).to_datetime
data/lib/stytch/m2m.rb CHANGED
@@ -184,10 +184,13 @@ module Stytch
184
184
  # If clock_tolerance_seconds is not supplied 0 seconds will be used as the default.
185
185
  def authenticate_token_local(jwt, clock_tolerance_seconds: nil)
186
186
  clock_tolerance_seconds = 0 if clock_tolerance_seconds.nil?
187
- issuer = 'stytch.com/' + @project_id
187
+ default_issuer = 'stytch.com/' + @project_id
188
+ base_url_issuer = @connection.api_host
189
+ valid_issuers = [default_issuer, base_url_issuer]
190
+
188
191
  begin
189
192
  decoded_token = JWT.decode jwt, nil, true,
190
- { jwks: @jwks_loader, iss: issuer, verify_iss: true, aud: @project_id, verify_aud: true, algorithms: ['RS256'], nbf_leeway: clock_tolerance_seconds }
193
+ { jwks: @jwks_loader, iss: valid_issuers, verify_iss: true, aud: @project_id, verify_aud: true, algorithms: ['RS256'], nbf_leeway: clock_tolerance_seconds }
191
194
  decoded_token[0]
192
195
  rescue JWT::InvalidIssuerError
193
196
  raise JWTInvalidIssuerError
@@ -384,10 +384,13 @@ module Stytch
384
384
  max_token_age_seconds = 300 if max_token_age_seconds.nil?
385
385
  clock_tolerance_seconds = 0 if clock_tolerance_seconds.nil?
386
386
 
387
- issuer = 'stytch.com/' + @project_id
387
+ default_issuer = 'stytch.com/' + @project_id
388
+ base_url_issuer = @connection.api_host
389
+ valid_issuers = [default_issuer, base_url_issuer]
390
+
388
391
  begin
389
392
  decoded_token = JWT.decode session_jwt, nil, true,
390
- { jwks: @jwks_loader, iss: issuer, verify_iss: true, aud: @project_id, verify_aud: true, algorithms: ['RS256'], nbf_leeway: clock_tolerance_seconds }
393
+ { jwks: @jwks_loader, iss: valid_issuers, verify_iss: true, aud: @project_id, verify_aud: true, algorithms: ['RS256'], nbf_leeway: clock_tolerance_seconds }
391
394
 
392
395
  session = decoded_token[0]
393
396
  iat_time = Time.at(session['iat']).to_datetime
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '10.16.0'
4
+ VERSION = '10.17.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stytch
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.16.0
4
+ version: 10.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stytch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-23 00:00:00.000000000 Z
11
+ date: 2025-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday