stytch 3.8.0 → 3.9.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: 95b360d5a8279e14e7f5f296a1f87cf8a228f71199b8f7ad819c5738ffabed5c
4
- data.tar.gz: d039db12c094d0108053986133159641fb70f6ea78774fc8fb6c3d4bbd9cba08
3
+ metadata.gz: 93e1f89bed0f2c91f7caac140e7dc10b154d116eda9a0b89078f48336da15fcb
4
+ data.tar.gz: 736f9a25fd2e902024fab4ff5ce01eb21b26f8562d02236f6fc3f16bf37c63c0
5
5
  SHA512:
6
- metadata.gz: 49525be08d53de93aadce97f254d0e3526e9334119b11508b89a8234133ef23a27a880666b176b03ef57fb938c17c90adeb9804ce159e9832f60a7a7f9821972
7
- data.tar.gz: 4212ed7c21195091055bbfe24abe613c1f670216808fd51e15c39b565ab49b2252f941398fc82fd3480d2a5af8999056051a0696f7edd157390cb11bcbe0a16c
6
+ metadata.gz: 345ddac68abf1011f6cca16fa1115b3b45bfe9067b6b66883bc3fb57aad5f374c9174333473cefaab5314175fe42aa2cf840d89cc6112c4ba95513b79cc7db50
7
+ data.tar.gz: 437f1988244668c730bef3106ebca258c6b4ed846ebceef93d186a38bc0ea97e39dff6d6dd129790935a6b170c9580aff7c9736c7f0e1aaf42c344d8e5e8d900
@@ -15,8 +15,17 @@ module Stytch
15
15
  def initialize(connection, project_id)
16
16
  @connection = connection
17
17
  @project_id = project_id
18
- @jwks_loader = ->(options) do
19
- options[:invalidate] ? jwks(project_id: @project_id) : {}
18
+ @cache_last_update = 0
19
+ @jwks_loader = lambda do |options|
20
+ @cached_keys = nil if options[:invalidate] && @cache_last_update < Time.now.to_i - 300
21
+ @cached_keys ||= begin
22
+ @cache_last_update = Time.now.to_i
23
+ keys = []
24
+ jwks(project_id: @project_id)['keys'].each do |r|
25
+ keys << r
26
+ end
27
+ { keys: keys }
28
+ end
20
29
  end
21
30
  end
22
31
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '3.8.0'
4
+ VERSION = '3.9.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: 3.8.0
4
+ version: 3.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stytch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-29 00:00:00.000000000 Z
11
+ date: 2022-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday