aws-sdk-core 3.193.0 → 3.194.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/lru_cache.rb +75 -0
- data/lib/aws-sdk-core.rb +1 -0
- data/lib/aws-sdk-sso/client.rb +1 -1
- data/lib/aws-sdk-sso.rb +1 -1
- data/lib/aws-sdk-ssooidc/client.rb +1 -1
- data/lib/aws-sdk-ssooidc.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- data/lib/aws-sdk-sts.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 722f50328245a39f18cb52639414b319e70d1731ad38e555a7c57b67725e0d3a
|
4
|
+
data.tar.gz: 9fe0e1e6a73de18c19773e94e68af1afd8db7366a407bf1527932e16fa7380be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e040e52bbf5f89ca4f19658e17af770d4207c1c1ca92d377910472b99f69cd49474c7d321336315e3b9643efe18b2c4645dc0c66a1cd5bce5ea71d244c855432
|
7
|
+
data.tar.gz: 87abc4cf34f3d198a19d7a4818a3b62431dea78564adbec878177d15365209c52787a3d5ccb410506e48ea4f420f9f9bc52d5247957cf12f72f45cf7f1cc0230
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.194.0
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
# @api private
|
5
|
+
# A simple thread safe LRU cache
|
6
|
+
class LRUCache
|
7
|
+
# @param [Hash] options
|
8
|
+
# @option options [Integer] :max_entries (100) Maximum number of entries
|
9
|
+
# @option options [Integer] :expiration (nil) Expiration time in seconds
|
10
|
+
def initialize(options = {})
|
11
|
+
@max_entries = options[:max_entries] || 100
|
12
|
+
@expiration = options[:expiration]
|
13
|
+
@entries = {}
|
14
|
+
@mutex = Mutex.new
|
15
|
+
end
|
16
|
+
|
17
|
+
# @param [String] key
|
18
|
+
# @return [Object]
|
19
|
+
def [](key)
|
20
|
+
@mutex.synchronize do
|
21
|
+
value = @entries[key]
|
22
|
+
if value
|
23
|
+
@entries.delete(key)
|
24
|
+
@entries[key] = value unless value.expired?
|
25
|
+
end
|
26
|
+
@entries[key]&.value
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# @param [String] key
|
31
|
+
# @param [Object] value
|
32
|
+
def []=(key, value)
|
33
|
+
@mutex.synchronize do
|
34
|
+
@entries.shift unless @entries.size < @max_entries
|
35
|
+
# delete old value if exists
|
36
|
+
@entries.delete(key)
|
37
|
+
@entries[key] = Entry.new(value: value, expiration: @expiration)
|
38
|
+
@entries[key].value
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# @param [String] key
|
43
|
+
# @return [Boolean]
|
44
|
+
def key?(key)
|
45
|
+
@mutex.synchronize do
|
46
|
+
@entries.delete(key) if @entries.key?(key) && @entries[key].expired?
|
47
|
+
@entries.key?(key)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def clear
|
52
|
+
@mutex.synchronize do
|
53
|
+
@entries.clear
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# @api private
|
58
|
+
class Entry
|
59
|
+
def initialize(options = {})
|
60
|
+
@value = options[:value]
|
61
|
+
@expiration = options[:expiration]
|
62
|
+
@created_time = Time.now
|
63
|
+
end
|
64
|
+
|
65
|
+
# @return [Object]
|
66
|
+
attr_reader :value
|
67
|
+
|
68
|
+
def expired?
|
69
|
+
return false unless @expiration
|
70
|
+
|
71
|
+
Time.now - @created_time > @expiration
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
data/lib/aws-sdk-core.rb
CHANGED
@@ -96,6 +96,7 @@ require_relative 'aws-sdk-core/client_side_monitoring/publisher'
|
|
96
96
|
require_relative 'aws-sdk-core/arn'
|
97
97
|
require_relative 'aws-sdk-core/arn_parser'
|
98
98
|
require_relative 'aws-sdk-core/ec2_metadata'
|
99
|
+
require_relative 'aws-sdk-core/lru_cache'
|
99
100
|
|
100
101
|
# dynamic endpoints
|
101
102
|
require_relative 'aws-sdk-core/endpoints'
|
data/lib/aws-sdk-sso/client.rb
CHANGED
data/lib/aws-sdk-sso.rb
CHANGED
data/lib/aws-sdk-ssooidc.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
@@ -2376,7 +2376,7 @@ module Aws::STS
|
|
2376
2376
|
params: params,
|
2377
2377
|
config: config)
|
2378
2378
|
context[:gem_name] = 'aws-sdk-core'
|
2379
|
-
context[:gem_version] = '3.
|
2379
|
+
context[:gem_version] = '3.194.0'
|
2380
2380
|
Seahorse::Client::Request.new(handlers, context)
|
2381
2381
|
end
|
2382
2382
|
|
data/lib/aws-sdk-sts.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.194.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jmespath
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- lib/aws-sdk-core/log/handler.rb
|
152
152
|
- lib/aws-sdk-core/log/param_filter.rb
|
153
153
|
- lib/aws-sdk-core/log/param_formatter.rb
|
154
|
+
- lib/aws-sdk-core/lru_cache.rb
|
154
155
|
- lib/aws-sdk-core/pageable_response.rb
|
155
156
|
- lib/aws-sdk-core/pager.rb
|
156
157
|
- lib/aws-sdk-core/param_converter.rb
|