roda 3.100.0 → 3.101.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40eb39afa6860fdb8612711cf75ce0f5dfcb73fa3af2837fd2d2a0a0f2a2739f
4
- data.tar.gz: 0f3b1d45dd9d78c0840e705d61344abcd11312b1d8d0e1cdf5c2cd249ba50bc9
3
+ metadata.gz: a7b1458c27a93cf829302766fa6299abadc1b52a7cc45375c23e588d0a28bbf7
4
+ data.tar.gz: d9312bd50698b9eba385272903d3c12a04f5d699185f299b5ddc250fdcbac2ac
5
5
  SHA512:
6
- metadata.gz: 3640eeb3784285b94ef078c79eccdd69feebfcab19ee0ec0d6858e7959343511af1c173d590043221484ea99b3dd7ef7a2345a1dc26808e683b5781f6f6a4626
7
- data.tar.gz: 4c739d613fcff7aa56f5dff3c6d83c26ace1a040aebb2f6ed4808086814f93b4f7858b4a968188fecc7e09eb0b7224ff62e44dcd32db6d1e9f22a09fa74ae029
6
+ metadata.gz: 1483575934392739f5ee8c79cd74ca78f434ba9d798d9c2066f24f737f39fbfd0c0ad818acbd28b113ffaedf7751b3c45302ee17f8590c1dd47d6072de785453
7
+ data.tar.gz: 20f6bc4308bcebd17abc063c4303487d80fd2ac63a1a35b35b99ae0ed2a2a82cf2c5effb480464817a3c1fbed343006a74547743022b1b2e2717c16164f06740
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2023 Jeremy Evans
1
+ Copyright (c) 2014-2026 Jeremy Evans and contributors
2
2
  Copyright (c) 2010-2014 Michel Martens, Damian Janowski and Cyril David
3
3
  Copyright (c) 2008-2009 Christian Neukirchen
4
4
 
@@ -0,0 +1,28 @@
1
+ # frozen-string-literal: true
2
+
3
+ #
4
+ class Roda
5
+ module RodaPlugins
6
+ # The bearer_token plugin adds an +r.bearer_token+ method for retrieving
7
+ # a bearer token from the +Authorization+ HTTP header. Bearer tokens will
8
+ # in the authorization header will be recognized as long as they start
9
+ # with the case insensitive string "bearer ".
10
+ module BearerToken
11
+ # :nocov:
12
+ METHOD = RUBY_VERSION >= "2.4" ? :match? : :match
13
+ # :nocov:
14
+
15
+ module RequestMethods
16
+ # Return the bearer token for the request if there is one in the
17
+ # authorization HTTP header.
18
+ def bearer_token
19
+ if (auth = @env["HTTP_AUTHORIZATION"]) && auth.send(METHOD, /\Abearer /i)
20
+ auth[7, 100000000]
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ register_plugin(:bearer_token, BearerToken)
27
+ end
28
+ end
data/lib/roda/version.rb CHANGED
@@ -4,7 +4,7 @@ class Roda
4
4
  RodaMajorVersion = 3
5
5
 
6
6
  # The minor version of Roda, updated for new feature releases of Roda.
7
- RodaMinorVersion = 100
7
+ RodaMinorVersion = 101
8
8
 
9
9
  # The patch version of Roda, updated only for bug fixes from the last
10
10
  # feature release.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.100.0
4
+ version: 3.101.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
@@ -176,6 +176,7 @@ files:
176
176
  - lib/roda/plugins/autoload_hash_branches.rb
177
177
  - lib/roda/plugins/autoload_named_routes.rb
178
178
  - lib/roda/plugins/backtracking_array.rb
179
+ - lib/roda/plugins/bearer_token.rb
179
180
  - lib/roda/plugins/branch_locals.rb
180
181
  - lib/roda/plugins/break.rb
181
182
  - lib/roda/plugins/caching.rb