keyless 1.4.0 → 1.6.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: f607f7f3118c5e025273da1d5b6c4070b3c19ba639fd8d82a59550c07d3a8daa
4
- data.tar.gz: 1001e9213845c2dfc1554b9d0fdcda2a3aa3cb11f95152029ca7e34cccd40f20
3
+ metadata.gz: dbc95fbabb0cbdb850e0f0a7ec811a050df4a6f43d8c761ff2703312f355429a
4
+ data.tar.gz: 6b890ac7e7ee3e920567039b704d6dd6a23f7b31c8c2c9cf5409ad8cf95d00d0
5
5
  SHA512:
6
- metadata.gz: fdc2a9e941fd3af9dd9796f4bc51908bacbaaaf81dc93f071e8405b9a609c0572385725913b5d0443533aca7227cb563a858260f0755383d05d3af46e152ed99
7
- data.tar.gz: 4206fc77b17e57df64153ab30071787c020f159bdcd12fd9489c8d810e40ff712e6fa3be5023174d1580af5055d341c531e7543dc9d764c06c2a5a114d49515f
6
+ metadata.gz: 4c2b57068e0513809930c46ae26d45d6ab3c8cc6a536444f4bb4ba641c5f8cacf476a7b1209afaa48077fe4ce5a523461122932ab9e7c6fd715d431df72058bd
7
+ data.tar.gz: 4faffaff2617f964018c6ff6f3dc4e54290b339d9a02cf38ee71836e7d615001ab998159e2a6667c6f3a3f26acda1851a5b6973fa1f956395b9b3a84f4b5c21c
@@ -18,8 +18,8 @@ jobs:
18
18
  strategy:
19
19
  fail-fast: false
20
20
  matrix:
21
- ruby: ['2.7']
22
- rails: ['5.2', '6.1', '7.1']
21
+ ruby: ['2.7', '3.0']
22
+ rails: ['6.1', '7.1']
23
23
  env:
24
24
  BUNDLE_GEMFILE: 'gemfiles/rails_${{ matrix.rails }}.gemfile'
25
25
  steps:
data/.rubocop.yml CHANGED
@@ -13,7 +13,7 @@ AllCops:
13
13
  SuggestExtensions: false
14
14
  DisplayCopNames: true
15
15
  TargetRubyVersion: 2.7
16
- TargetRailsVersion: 5.2
16
+ TargetRailsVersion: 6.1
17
17
  Exclude:
18
18
  - bin/**/*
19
19
  - vendor/**/*
data/Appraisals CHANGED
@@ -1,9 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- appraise 'rails-5.2' do
4
- gem 'activesupport', '~> 5.2.0'
5
- end
6
-
7
3
  appraise 'rails-6.1' do
8
4
  gem 'activesupport', '~> 6.1.0'
9
5
  end
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  * TODO: Replace this bullet point with an actual description of a change.
4
4
 
5
+ ### 1.6.0 (11 January 2025)
6
+
7
+ * Switched to Zeitwerk as autoloader (#7)
8
+
9
+ ### 1.5.0 (3 January 2025)
10
+
11
+ * Raised minimum supported Ruby/Rails version to 2.7/6.1 (#6)
12
+
5
13
  ### 1.4.0 (4 October 2024)
6
14
 
7
15
  * Upgraded the `recursive-open-struct` gem to `~> 2.0` (#5)
data/Gemfile CHANGED
@@ -12,7 +12,7 @@ gem 'appraisal', '~> 2.4'
12
12
  gem 'bundler', '~> 2.3'
13
13
  gem 'countless', '~> 1.1'
14
14
  gem 'guard-rspec', '~> 4.7'
15
- gem 'railties', '>= 5.2'
15
+ gem 'railties', '>= 6.1'
16
16
  gem 'rake', '~> 13.0'
17
17
  gem 'rspec', '~> 3.12'
18
18
  gem 'rubocop', '~> 1.28'
@@ -6,7 +6,7 @@ gem "appraisal", "~> 2.4"
6
6
  gem "bundler", "~> 2.3"
7
7
  gem "countless", "~> 1.1"
8
8
  gem "guard-rspec", "~> 4.7"
9
- gem "railties", ">= 5.2"
9
+ gem "railties", ">= 6.1"
10
10
  gem "rake", "~> 13.0"
11
11
  gem "rspec", "~> 3.12"
12
12
  gem "rubocop", "~> 1.28"
@@ -6,7 +6,7 @@ gem "appraisal", "~> 2.4"
6
6
  gem "bundler", "~> 2.3"
7
7
  gem "countless", "~> 1.1"
8
8
  gem "guard-rspec", "~> 4.7"
9
- gem "railties", ">= 5.2"
9
+ gem "railties", ">= 6.1"
10
10
  gem "rake", "~> 13.0"
11
11
  gem "rspec", "~> 3.12"
12
12
  gem "rubocop", "~> 1.28"
data/keyless.gemspec CHANGED
@@ -35,8 +35,9 @@ Gem::Specification.new do |spec|
35
35
 
36
36
  spec.required_ruby_version = '>= 2.7'
37
37
 
38
- spec.add_dependency 'activesupport', '>= 5.2'
38
+ spec.add_dependency 'activesupport', '>= 6.1'
39
39
  spec.add_dependency 'httparty', '>= 0.21'
40
40
  spec.add_dependency 'jwt', '~> 2.6'
41
41
  spec.add_dependency 'recursive-open-struct', '~> 2.0'
42
+ spec.add_dependency 'zeitwerk', '~> 2.6'
42
43
  end
data/lib/keyless/jwt.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'recursive-open-struct'
4
-
5
3
  module Keyless
6
4
  # A easy to use model for verification of JSON Web Tokens. This is just a
7
5
  # wrapper class for the excellent ruby-jwt gem. It's completely up to you
@@ -1,9 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'singleton'
4
- require 'openssl'
5
- require 'httparty'
6
-
7
3
  module Keyless
8
4
  # A common purpose RSA public key fetching/caching helper. With the help
9
5
  # of this class you are able to retrieve the RSA public key from a remote
@@ -3,7 +3,7 @@
3
3
  # The gem version details.
4
4
  module Keyless
5
5
  # The version of the +keyless+ gem
6
- VERSION = '1.4.0'
6
+ VERSION = '1.6.0'
7
7
 
8
8
  class << self
9
9
  # Returns the version of gem as a string.
data/lib/keyless.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'zeitwerk'
3
4
  require 'active_support'
4
5
  require 'active_support/concern'
5
6
  require 'active_support/configurable'
@@ -8,38 +9,48 @@ require 'active_support/core_ext/hash'
8
9
  require 'active_support/time'
9
10
  require 'active_support/time_with_zone'
10
11
  require 'jwt'
11
- require 'keyless/version'
12
- require 'keyless/configuration'
13
- require 'keyless/jwt'
14
- require 'keyless/rsa_public_key'
12
+ require 'recursive-open-struct'
13
+ require 'singleton'
14
+ require 'openssl'
15
+ require 'httparty'
15
16
 
16
17
  # The JWT authentication concern.
17
18
  module Keyless
18
- extend ActiveSupport::Concern
19
+ # Setup a Zeitwerk autoloader instance and configure it
20
+ loader = Zeitwerk::Loader.for_gem
21
+
22
+ # Finish the auto loader configuration
23
+ loader.setup
24
+
25
+ # Load standalone code
26
+ require 'keyless/version'
27
+
28
+ # Make sure to eager load all SDK constants
29
+ loader.eager_load
19
30
 
20
31
  class << self
21
32
  attr_writer :configuration
22
- end
23
33
 
24
- # Retrieve the current configuration object.
25
- #
26
- # @return [Configuration]
27
- def self.configuration
28
- @configuration ||= Configuration.new
29
- end
34
+ # Retrieve the current configuration object.
35
+ #
36
+ # @return [Configuration]
37
+ def configuration
38
+ @configuration ||= Configuration.new
39
+ end
30
40
 
31
- # Configure the concern by providing a block which takes
32
- # care of this task. Example:
33
- #
34
- # Keyless.configure do |conf|
35
- # # conf.xyz = [..]
36
- # end
37
- def self.configure
38
- yield(configuration)
39
- end
41
+ # Configure the concern by providing a block which takes
42
+ # care of this task. Example:
43
+ #
44
+ # Keyless.configure do |conf|
45
+ # # conf.xyz = [..]
46
+ # end
47
+ def configure
48
+ yield(configuration)
49
+ end
40
50
 
41
- # Reset the current configuration with the default one.
42
- def self.reset_configuration!
43
- self.configuration = Configuration.new
51
+ # Reset the current configuration with the default one.
52
+ def reset_configuration!
53
+ self.configuration = Configuration.new
54
+ end
44
55
  end
45
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keyless
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2024-10-04 00:00:00.000000000 Z
13
+ date: 2025-01-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: '5.2'
21
+ version: '6.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: '5.2'
28
+ version: '6.1'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: httparty
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -68,6 +68,20 @@ dependencies:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
70
  version: '2.0'
71
+ - !ruby/object:Gem::Dependency
72
+ name: zeitwerk
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '2.6'
78
+ type: :runtime
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - "~>"
83
+ - !ruby/object:Gem::Version
84
+ version: '2.6'
71
85
  description: A reusable JWT authentication helper
72
86
  email:
73
87
  - hermann.mayer92@gmail.com
@@ -103,7 +117,6 @@ files:
103
117
  - config/docker/.inputrc
104
118
  - doc/assets/project.svg
105
119
  - docker-compose.yml
106
- - gemfiles/rails_5.2.gemfile
107
120
  - gemfiles/rails_6.1.gemfile
108
121
  - gemfiles/rails_7.1.gemfile
109
122
  - keyless.gemspec
@@ -1,23 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal", "~> 2.4"
6
- gem "bundler", "~> 2.3"
7
- gem "countless", "~> 1.1"
8
- gem "guard-rspec", "~> 4.7"
9
- gem "railties", ">= 5.2"
10
- gem "rake", "~> 13.0"
11
- gem "rspec", "~> 3.12"
12
- gem "rubocop", "~> 1.28"
13
- gem "rubocop-rails", "~> 2.14"
14
- gem "rubocop-rspec", "~> 2.10"
15
- gem "simplecov", ">= 0.22"
16
- gem "timecop", ">= 0.9.6"
17
- gem "vcr", "~> 6.0"
18
- gem "webmock", "~> 3.18"
19
- gem "yard", ">= 0.9.28"
20
- gem "yard-activesupport-concern", ">= 0.0.1"
21
- gem "activesupport", "~> 5.2.0"
22
-
23
- gemspec path: "../"