keyless 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5d30d3e8b901149287687579a944c73da6c0808f7e7faf6db7dfdd3973d764f
4
- data.tar.gz: 3c1e8727a30b950a0c5c304b9586e6d62ea28ddec9599f6ac5ff2db401177265
3
+ metadata.gz: dbc95fbabb0cbdb850e0f0a7ec811a050df4a6f43d8c761ff2703312f355429a
4
+ data.tar.gz: 6b890ac7e7ee3e920567039b704d6dd6a23f7b31c8c2c9cf5409ad8cf95d00d0
5
5
  SHA512:
6
- metadata.gz: 30c25b0a1604353262c2662eabe884b0d05992c09fa2d8900a21cba64f2c40bb229a17ed18d81797d6baa32471adc504000370f34167c2e4c4a1cce51ce444df
7
- data.tar.gz: 0f653dfaf0c50f9b4584c4a7b04f3090903c4134d95c4d0b3ac7a50e1d4401c71ad5de54ce6d486ea7b629a89b8164e175a3e27af9b923e9cdc0aefeb8c0e7b0
6
+ metadata.gz: 4c2b57068e0513809930c46ae26d45d6ab3c8cc6a536444f4bb4ba641c5f8cacf476a7b1209afaa48077fe4ce5a523461122932ab9e7c6fd715d431df72058bd
7
+ data.tar.gz: 4faffaff2617f964018c6ff6f3dc4e54290b339d9a02cf38ee71836e7d615001ab998159e2a6667c6f3a3f26acda1851a5b6973fa1f956395b9b3a84f4b5c21c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
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
+
5
9
  ### 1.5.0 (3 January 2025)
6
10
 
7
11
  * 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.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.5.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: 2025-01-03 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
@@ -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