ipscope 1.0.0 → 1.1.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 +85 -0
- data/README.md +40 -10
- data/lib/ipscope/client.rb +42 -13
- data/lib/ipscope/models.rb +505 -317
- data/lib/ipscope/transport.rb +7 -8
- data/lib/ipscope/validator.rb +1 -1
- data/lib/ipscope/version.rb +1 -1
- metadata +3 -2
data/lib/ipscope/transport.rb
CHANGED
|
@@ -114,19 +114,18 @@ module IpScope
|
|
|
114
114
|
def self.extract_rate_limit_metadata(headers)
|
|
115
115
|
limit = parse_header_int(headers["x-ratelimit-limit"])
|
|
116
116
|
remaining = parse_header_int(headers["x-ratelimit-remaining"])
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
# `X-RateLimit-Reset` is the number of seconds until the window resets.
|
|
118
|
+
reset_after = parse_header_int(headers["x-ratelimit-reset"])
|
|
119
|
+
scope_raw = headers["x-ratelimit-scope"].to_s.strip
|
|
120
|
+
scope = scope_raw.empty? ? nil : scope_raw
|
|
121
121
|
|
|
122
|
-
return nil if limit.nil? && remaining.nil? &&
|
|
122
|
+
return nil if limit.nil? && remaining.nil? && reset_after.nil? && scope.nil?
|
|
123
123
|
|
|
124
124
|
RateLimitMetadata.new(
|
|
125
125
|
limit: limit,
|
|
126
126
|
remaining: remaining,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
plan_tier: tier
|
|
127
|
+
reset_after_seconds: reset_after,
|
|
128
|
+
scope: scope
|
|
130
129
|
)
|
|
131
130
|
end
|
|
132
131
|
|
data/lib/ipscope/validator.rb
CHANGED
|
@@ -14,7 +14,7 @@ module IpScope
|
|
|
14
14
|
trimmed = api_key.to_s.strip
|
|
15
15
|
if trimmed.empty? || trimmed.length < 8
|
|
16
16
|
raise IpScopeValidationError.new(
|
|
17
|
-
'A valid IPScope API key ("
|
|
17
|
+
'A valid IPScope API key ("<public>:<private>") is required.',
|
|
18
18
|
field: "api_key"
|
|
19
19
|
)
|
|
20
20
|
end
|
data/lib/ipscope/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ipscope
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- IPScope Engineering
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10
|
|
11
|
+
date: 2026-11-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Server-side Ruby SDK for IPScope providing single IP lookup, batch lookup,
|
|
14
14
|
constant-RAM streaming batch lookup, CIDR network prefix lookup, dataset metadata,
|
|
@@ -19,6 +19,7 @@ executables: []
|
|
|
19
19
|
extensions: []
|
|
20
20
|
extra_rdoc_files: []
|
|
21
21
|
files:
|
|
22
|
+
- CHANGELOG.md
|
|
22
23
|
- LICENSE
|
|
23
24
|
- README.md
|
|
24
25
|
- lib/ipscope.rb
|