grape-jwt-authentication 3.0.0 → 3.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/.github/workflows/release.yml +1 -1
- data/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +1 -1
- data/Appraisals +6 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +1 -1
- data/gemfiles/rails_7.1.gemfile +1 -1
- data/gemfiles/rails_7.2.gemfile +1 -1
- data/gemfiles/rails_8.0.gemfile +1 -1
- data/gemfiles/rails_8.1.gemfile +27 -0
- data/grape-jwt-authentication.gemspec +2 -2
- data/lib/grape/jwt/authentication/configuration.rb +40 -2
- data/lib/grape/jwt/authentication/jwt_handler.rb +0 -2
- data/lib/grape/jwt/authentication/version.rb +1 -1
- data/lib/grape/jwt/authentication.rb +2 -1
- metadata +8 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 459e156f435fe23849864abf466f5d0e26956666b9de49fd73f1361e994e7e6b
|
|
4
|
+
data.tar.gz: f5a8808829644c1c92c86a402b257c7bcbea22eef0fffa4f0e508896c59e1ca4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6b79f8023b60a85d4cc7b00fe89a9fb8dda847e6cd9cf4f31718e7e174546320f995fbed0c4dbc4efee61ec324e149bc969eb5a45017bab9a4b383a109753105
|
|
7
|
+
data.tar.gz: a59eb397555bdd6ff85803bfa266c1017c292ec0ed7fff67c0ecc35154a915e4b010cac83f1bf1cf57e6589857206b63ac55cfe497b90c374db416cdef5f15aa
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
* TODO: Replace this bullet point with an actual description of a change.
|
|
4
4
|
|
|
5
|
+
### 3.1.0 (23 October 2025)
|
|
6
|
+
|
|
7
|
+
* Dropped Reek ([#24](https://github.com/hausgold/grape-jwt-authentication/pull/24))
|
|
8
|
+
* Added support for Rails 8.1 ([#25](https://github.com/hausgold/grape-jwt-authentication/pull/25))
|
|
9
|
+
* Switched from `ActiveSupport::Configurable` to a custom implementation based
|
|
10
|
+
on `ActiveSupport::OrderedOptions` ([#26](https://github.com/hausgold/grape-jwt-authentication/pull/26))
|
|
11
|
+
|
|
5
12
|
### 3.0.0 (28 June 2025)
|
|
6
13
|
|
|
7
14
|
* Corrected some RuboCop glitches ([#21](https://github.com/hausgold/grape-jwt-authentication/pull/21))
|
data/Gemfile
CHANGED
data/gemfiles/rails_7.1.gemfile
CHANGED
data/gemfiles/rails_7.2.gemfile
CHANGED
data/gemfiles/rails_8.0.gemfile
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "appraisal", "~> 2.4"
|
|
6
|
+
gem "bundler", "~> 2.6"
|
|
7
|
+
gem "countless", "~> 2.2"
|
|
8
|
+
gem "guard-rspec", "~> 4.7"
|
|
9
|
+
gem "rack", "~> 2.2"
|
|
10
|
+
gem "rack-test", "~> 2.0"
|
|
11
|
+
gem "railties", ">= 7.1"
|
|
12
|
+
gem "rake", "~> 13.0"
|
|
13
|
+
gem "rspec", "~> 3.12"
|
|
14
|
+
gem "rubocop"
|
|
15
|
+
gem "rubocop-rails"
|
|
16
|
+
gem "rubocop-rspec"
|
|
17
|
+
gem "simplecov", ">= 0.22"
|
|
18
|
+
gem "timecop", ">= 0.9.6"
|
|
19
|
+
gem "vcr", "~> 6.0"
|
|
20
|
+
gem "webmock", "~> 3.18"
|
|
21
|
+
gem "yard", ">= 0.9.28"
|
|
22
|
+
gem "yard-activesupport-concern", ">= 0.0.1"
|
|
23
|
+
gem "activejob", "~> 8.1.0"
|
|
24
|
+
gem "activerecord", "~> 8.1.0"
|
|
25
|
+
gem "activesupport", "~> 8.1.0"
|
|
26
|
+
|
|
27
|
+
gemspec path: "../"
|
|
@@ -37,8 +37,8 @@ Gem::Specification.new do |spec|
|
|
|
37
37
|
spec.add_dependency 'grape', '>= 1.0', '< 3.0'
|
|
38
38
|
spec.add_dependency 'httparty', '>= 0.21'
|
|
39
39
|
spec.add_dependency 'jwt', '~> 2.6'
|
|
40
|
-
spec.add_dependency 'keyless', '~> 2.
|
|
41
|
-
spec.add_dependency 'mutex_m', '
|
|
40
|
+
spec.add_dependency 'keyless', '~> 2.1'
|
|
41
|
+
spec.add_dependency 'mutex_m', '>= 0.3'
|
|
42
42
|
spec.add_dependency 'recursive-open-struct', '~> 2.0'
|
|
43
43
|
spec.add_dependency 'zeitwerk', '~> 2.6'
|
|
44
44
|
end
|
|
@@ -4,8 +4,46 @@ module Grape
|
|
|
4
4
|
module Jwt
|
|
5
5
|
module Authentication
|
|
6
6
|
# The configuration for the Grape JWT authentication concern.
|
|
7
|
-
class Configuration
|
|
8
|
-
|
|
7
|
+
class Configuration < ActiveSupport::OrderedOptions
|
|
8
|
+
# Track our configurations settings (+Symbol+ keys) and their defaults
|
|
9
|
+
# as lazy-loaded +Proc+'s values
|
|
10
|
+
class_attribute :defaults,
|
|
11
|
+
instance_reader: true,
|
|
12
|
+
instance_writer: false,
|
|
13
|
+
instance_predicate: false,
|
|
14
|
+
default: {}
|
|
15
|
+
|
|
16
|
+
# Create a new +Configuration+ instance with all settings populated
|
|
17
|
+
# with their respective defaults.
|
|
18
|
+
#
|
|
19
|
+
# @param args [Hash{Symbol => Mixed}] additional settings which
|
|
20
|
+
# overwrite the defaults
|
|
21
|
+
# @return [Configuration] the new configuration instance
|
|
22
|
+
def initialize(**args)
|
|
23
|
+
super()
|
|
24
|
+
defaults.each { |key, default| self[key] = instance_exec(&default) }
|
|
25
|
+
merge!(**args)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# A simple DSL method to define new configuration accessors/settings
|
|
29
|
+
# with their defaults. The defaults can be retrieved with
|
|
30
|
+
# +Configuration.defaults+ or +Configuration.new.defaults+.
|
|
31
|
+
#
|
|
32
|
+
# @param name [Symbol, String] the name of the configuration
|
|
33
|
+
# accessor/setting
|
|
34
|
+
# @param default [Mixed, nil] a non-lazy-loaded static value, serving
|
|
35
|
+
# as a default value for the setting
|
|
36
|
+
# @param block [Proc] when given, the default value will be lazy-loaded
|
|
37
|
+
# (result of the Proc)
|
|
38
|
+
def self.config_accessor(name, default = nil, &block)
|
|
39
|
+
# Save the given configuration accessor default value
|
|
40
|
+
defaults[name.to_sym] = block || -> { default }
|
|
41
|
+
|
|
42
|
+
# Compile reader/writer methods so we don't have to go through
|
|
43
|
+
# +ActiveSupport::OrderedOptions#method_missing+.
|
|
44
|
+
define_method(name) { self[name] }
|
|
45
|
+
define_method("#{name}=") { |value| self[name] = value }
|
|
46
|
+
end
|
|
9
47
|
|
|
10
48
|
# The authenticator function which must be defined by the user to
|
|
11
49
|
# verify the given JSON Web Token. Here comes all your logic to lookup
|
|
@@ -102,8 +102,6 @@ module Grape
|
|
|
102
102
|
# interface.
|
|
103
103
|
#
|
|
104
104
|
# @param env [Hash{String => Mixed}] the Rack environment
|
|
105
|
-
# because thats the auth handling core
|
|
106
|
-
# :reek:TooManyStatements because reek counts exception
|
|
107
105
|
def call(env)
|
|
108
106
|
# Unfortunately Grape's middleware stack orders the error
|
|
109
107
|
# handling higher than the formatter. So when a error is
|
|
@@ -4,8 +4,9 @@ require 'zeitwerk'
|
|
|
4
4
|
require 'logger'
|
|
5
5
|
require 'active_support'
|
|
6
6
|
require 'active_support/concern'
|
|
7
|
-
require 'active_support/configurable'
|
|
8
7
|
require 'active_support/cache'
|
|
8
|
+
require 'active_support/ordered_options'
|
|
9
|
+
require 'active_support/core_ext/class/attribute'
|
|
9
10
|
require 'active_support/core_ext/hash'
|
|
10
11
|
require 'active_support/time'
|
|
11
12
|
require 'active_support/time_with_zone'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: grape-jwt-authentication
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hermann Mayer
|
|
@@ -77,28 +77,28 @@ dependencies:
|
|
|
77
77
|
requirements:
|
|
78
78
|
- - "~>"
|
|
79
79
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: '2.
|
|
80
|
+
version: '2.1'
|
|
81
81
|
type: :runtime
|
|
82
82
|
prerelease: false
|
|
83
83
|
version_requirements: !ruby/object:Gem::Requirement
|
|
84
84
|
requirements:
|
|
85
85
|
- - "~>"
|
|
86
86
|
- !ruby/object:Gem::Version
|
|
87
|
-
version: '2.
|
|
87
|
+
version: '2.1'
|
|
88
88
|
- !ruby/object:Gem::Dependency
|
|
89
89
|
name: mutex_m
|
|
90
90
|
requirement: !ruby/object:Gem::Requirement
|
|
91
91
|
requirements:
|
|
92
|
-
- - "
|
|
92
|
+
- - ">="
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
|
-
version: 0.3
|
|
94
|
+
version: '0.3'
|
|
95
95
|
type: :runtime
|
|
96
96
|
prerelease: false
|
|
97
97
|
version_requirements: !ruby/object:Gem::Requirement
|
|
98
98
|
requirements:
|
|
99
|
-
- - "
|
|
99
|
+
- - ">="
|
|
100
100
|
- !ruby/object:Gem::Version
|
|
101
|
-
version: 0.3
|
|
101
|
+
version: '0.3'
|
|
102
102
|
- !ruby/object:Gem::Dependency
|
|
103
103
|
name: recursive-open-struct
|
|
104
104
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -164,6 +164,7 @@ files:
|
|
|
164
164
|
- gemfiles/rails_7.1.gemfile
|
|
165
165
|
- gemfiles/rails_7.2.gemfile
|
|
166
166
|
- gemfiles/rails_8.0.gemfile
|
|
167
|
+
- gemfiles/rails_8.1.gemfile
|
|
167
168
|
- grape-jwt-authentication.gemspec
|
|
168
169
|
- lib/grape/jwt/authentication.rb
|
|
169
170
|
- lib/grape/jwt/authentication/configuration.rb
|