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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33788b3f46ab68046b7a8401f063e1031d569d3acf8988c18ef3560f4cc75718
4
- data.tar.gz: 7e86a27a2abe25f6e603ec199c23ff8bb8b28aa7b67b98474dba44c1a9de2a5b
3
+ metadata.gz: c3b774acc4c65d4c0cdbf521440b8244b8dbbe7a3ba1bbdf353ea3ebedc1c3e9
4
+ data.tar.gz: ee7627e2a9ad3cd53e6298144633a1752700579ac3367fe1b771d215d179f488
5
5
  SHA512:
6
- metadata.gz: 7d2e03d4c0954afebfad666af8c6d493cadc94829d8dae825e507ca691a72774f303c6db013a5b5d964e1aa0a154df54a02cf8f9dac79be175685805ed1e9a0c
7
- data.tar.gz: fdb2a735a672d38461a816db3985b0cc18d62d6c08400942f11e6a716b4f1ca4277dc0df492d4dc4180a87002337ba7200cf2ffc2cc8ae4c92f09336b01984e7
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.5"
98
+ @sdk_version = "2.1.7"
99
99
  @gen_version = "internal"
100
- @user_agent = "noresponse-sdk/ruby 2.1.5 internal 1 noresponse"
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]]) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noresponse
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.5
4
+ version: 2.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - NoResponse