graph_attack 2.4.0 → 2.4.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/graph_attack/rate_limit.rb +6 -2
- data/lib/graph_attack/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd64b8cd2ba29de2f592c23f9fa7a0a13072cc043d2530490fb49b6a8c32cba2
|
4
|
+
data.tar.gz: c01f23e62b0491feefdd4d35d5a35ff3c793f01025e4a1b847cfc23723166510
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21eebd3639e76891ea71eb37b1fb1600f9a85c4d128e9c716d1800823d7deb915d4f21595f24e9694622dd3028271eed5953861f9da2b0a92990836f0594ebef
|
7
|
+
data.tar.gz: 0f73e8ac521a9b8e0baa627499ff985c9a35f3df6cf30b2bd48dc3e5482c0655a78c72e2aca00382ecea53cae05ff16776c3e7b5222f22ddb01e63aac6a72868
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -18,7 +18,7 @@ class QueryType < GraphQL::Schema::Object
|
|
18
18
|
end
|
19
19
|
```
|
20
20
|
|
21
|
-
This would allow
|
21
|
+
This would allow 15 requests per minute by the same IP address, blocking the 16th and subsequent requests within that 60-second window.
|
22
22
|
|
23
23
|
## Requirements
|
24
24
|
|
@@ -27,8 +27,12 @@ module GraphAttack
|
|
27
27
|
def calls_exceeded_on_query?(rate_limited_field)
|
28
28
|
with_redis_client do |redis_client|
|
29
29
|
rate_limit = Ratelimit.new(rate_limited_field, redis: redis_client)
|
30
|
-
rate_limit.
|
31
|
-
|
30
|
+
if rate_limit.exceeded?(key, threshold: threshold, interval: interval)
|
31
|
+
true
|
32
|
+
else
|
33
|
+
rate_limit.add(key)
|
34
|
+
false
|
35
|
+
end
|
32
36
|
end
|
33
37
|
end
|
34
38
|
|
data/lib/graph_attack/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graph_attack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fanny Cheung
|
8
8
|
- Sunny Ripert
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|