keyless 1.5.0 → 1.6.1

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: e5d30d3e8b901149287687579a944c73da6c0808f7e7faf6db7dfdd3973d764f
4
- data.tar.gz: 3c1e8727a30b950a0c5c304b9586e6d62ea28ddec9599f6ac5ff2db401177265
3
+ metadata.gz: 471c0ae36d1f23b83576bc96376e23fd555f39334aaa014010f35ae075383205
4
+ data.tar.gz: 190d659844f47bdfa9f447c94512f0d5bd5881398e6a81f70f188a04f4e015d8
5
5
  SHA512:
6
- metadata.gz: 30c25b0a1604353262c2662eabe884b0d05992c09fa2d8900a21cba64f2c40bb229a17ed18d81797d6baa32471adc504000370f34167c2e4c4a1cce51ce444df
7
- data.tar.gz: 0f653dfaf0c50f9b4584c4a7b04f3090903c4134d95c4d0b3ac7a50e1d4401c71ad5de54ce6d486ea7b629a89b8164e175a3e27af9b923e9cdc0aefeb8c0e7b0
6
+ metadata.gz: 876e577221db4badd5b1414bdb3f9ad452a75d66dd1cb8db709334c19437b052af8732e09138e20fd30c3fcadd2f08a4dc3c9af1441702223d1124da45a38e02
7
+ data.tar.gz: a9c3f31fcd877ff267c8b842d65a683796cfb67f5ef541616d4826ec1992af34da2ae72299eb93355e200adc9325cc1d5e0a91786cd1792dfbb8a3d847ec687b
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.1 (17 January 2025)
6
+
7
+ * Added the logger dependency (#8)
8
+
9
+ ### 1.6.0 (11 January 2025)
10
+
11
+ * Switched to Zeitwerk as autoloader (#7)
12
+
5
13
  ### 1.5.0 (3 January 2025)
6
14
 
7
15
  * Raised minimum supported Ruby/Rails version to 2.7/6.1 (#6)
data/keyless.gemspec CHANGED
@@ -39,4 +39,5 @@ Gem::Specification.new do |spec|
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.5.0'
6
+ VERSION = '1.6.1'
7
7
 
8
8
  class << self
9
9
  # Returns the version of gem as a string.
data/lib/keyless.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'zeitwerk'
4
+ require 'logger'
3
5
  require 'active_support'
4
6
  require 'active_support/concern'
5
7
  require 'active_support/configurable'
@@ -8,38 +10,48 @@ require 'active_support/core_ext/hash'
8
10
  require 'active_support/time'
9
11
  require 'active_support/time_with_zone'
10
12
  require 'jwt'
11
- require 'keyless/version'
12
- require 'keyless/configuration'
13
- require 'keyless/jwt'
14
- require 'keyless/rsa_public_key'
13
+ require 'recursive-open-struct'
14
+ require 'singleton'
15
+ require 'openssl'
16
+ require 'httparty'
15
17
 
16
18
  # The JWT authentication concern.
17
19
  module Keyless
18
- extend ActiveSupport::Concern
20
+ # Setup a Zeitwerk autoloader instance and configure it
21
+ loader = Zeitwerk::Loader.for_gem
22
+
23
+ # Finish the auto loader configuration
24
+ loader.setup
25
+
26
+ # Load standalone code
27
+ require 'keyless/version'
28
+
29
+ # Make sure to eager load all constants
30
+ loader.eager_load
19
31
 
20
32
  class << self
21
33
  attr_writer :configuration
22
- end
23
34
 
24
- # Retrieve the current configuration object.
25
- #
26
- # @return [Configuration]
27
- def self.configuration
28
- @configuration ||= Configuration.new
29
- end
35
+ # Retrieve the current configuration object.
36
+ #
37
+ # @return [Configuration]
38
+ def configuration
39
+ @configuration ||= Configuration.new
40
+ end
30
41
 
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
42
+ # Configure the concern by providing a block which takes
43
+ # care of this task. Example:
44
+ #
45
+ # Keyless.configure do |conf|
46
+ # # conf.xyz = [..]
47
+ # end
48
+ def configure
49
+ yield(configuration)
50
+ end
40
51
 
41
- # Reset the current configuration with the default one.
42
- def self.reset_configuration!
43
- self.configuration = Configuration.new
52
+ # Reset the current configuration with the default one.
53
+ def reset_configuration!
54
+ self.configuration = Configuration.new
55
+ end
44
56
  end
45
57
  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.5.0
4
+ version: 1.6.1
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: 2025-01-03 00:00:00.000000000 Z
13
+ date: 2025-01-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -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