noresponse 2.1.5 → 2.1.7
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/lib/no_response/late_results.rb +31 -0
- data/lib/no_response/sdkconfiguration.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c3b774acc4c65d4c0cdbf521440b8244b8dbbe7a3ba1bbdf353ea3ebedc1c3e9
|
|
4
|
+
data.tar.gz: ee7627e2a9ad3cd53e6298144633a1752700579ac3367fe1b771d215d179f488
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 352b23c23f11d7988c49c34bd649fe53372cfd11b90cd208c4635c2dc818d029b6d148d556164ae3e3e59b94743d006b6559a5cba798d4ebea921ccb6730d987
|
|
7
|
+
data.tar.gz: 545f42a0eed95f2fe04dea28b62891b7eb5fc8045441b20d2c3119925e3bcd81ca32d8a4f0ee63645d2f84420f8bf2d8863ee88ef705e7915b93c1d6f0a84087
|
|
@@ -156,6 +156,17 @@ module NoResponse
|
|
|
156
156
|
|
|
157
157
|
Auth0.new(Caller.new('auth0', base, "Bearer #{token}", http_client))
|
|
158
158
|
end
|
|
159
|
+
|
|
160
|
+
# A provider for an app with its own login, or for trying the handler
|
|
161
|
+
# before you wire up a real one. revoke_sessions and ban each log one
|
|
162
|
+
# line saying what they would do and call nothing: no request leaves
|
|
163
|
+
# your process. log is any callable that takes the line; the default
|
|
164
|
+
# writes it to standard error with Kernel#warn. Replace it with your own
|
|
165
|
+
# provider (name, revoke_sessions and ban) once you know what revoking
|
|
166
|
+
# and banning mean in your app.
|
|
167
|
+
def log_only(log: nil)
|
|
168
|
+
LogOnly.new(log || ->(line) { Kernel.warn(line) })
|
|
169
|
+
end
|
|
159
170
|
end
|
|
160
171
|
|
|
161
172
|
# One provider HTTP client: base URL, Authorization header, error mapping.
|
|
@@ -303,5 +314,25 @@ module NoResponse
|
|
|
303
314
|
revoke_sessions(user_id)
|
|
304
315
|
end
|
|
305
316
|
end
|
|
317
|
+
|
|
318
|
+
class LogOnly
|
|
319
|
+
def initialize(log)
|
|
320
|
+
@log = log
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
def name = 'log_only'
|
|
324
|
+
|
|
325
|
+
def revoke_sessions(user_id)
|
|
326
|
+
Segment.encode(user_id)
|
|
327
|
+
@log.call("NoResponse late result (log only): would revoke every session of user #{user_id}")
|
|
328
|
+
nil
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
def ban(user_id)
|
|
332
|
+
Segment.encode(user_id)
|
|
333
|
+
@log.call("NoResponse late result (log only): would ban user #{user_id} and end their sessions")
|
|
334
|
+
nil
|
|
335
|
+
end
|
|
336
|
+
end
|
|
306
337
|
end
|
|
307
338
|
end
|
|
@@ -95,9 +95,9 @@ module NoResponse
|
|
|
95
95
|
|
|
96
96
|
@language = "ruby"
|
|
97
97
|
@openapi_doc_version = "1"
|
|
98
|
-
@sdk_version = "2.1.
|
|
98
|
+
@sdk_version = "2.1.7"
|
|
99
99
|
@gen_version = "internal"
|
|
100
|
-
@user_agent = "noresponse-sdk/ruby 2.1.
|
|
100
|
+
@user_agent = "noresponse-sdk/ruby 2.1.7 internal 1 noresponse"
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
sig { returns([String, T::Hash[Symbol, String]]) }
|