keyless 1.5.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/keyless.gemspec +1 -0
- data/lib/keyless/jwt.rb +0 -2
- data/lib/keyless/rsa_public_key.rb +0 -4
- data/lib/keyless/version.rb +1 -1
- data/lib/keyless.rb +36 -24
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 471c0ae36d1f23b83576bc96376e23fd555f39334aaa014010f35ae075383205
|
4
|
+
data.tar.gz: 190d659844f47bdfa9f447c94512f0d5bd5881398e6a81f70f188a04f4e015d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/lib/keyless/jwt.rb
CHANGED
@@ -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
|
data/lib/keyless/version.rb
CHANGED
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 '
|
12
|
-
require '
|
13
|
-
require '
|
14
|
-
require '
|
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
|
-
|
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
35
|
+
# Retrieve the current configuration object.
|
36
|
+
#
|
37
|
+
# @return [Configuration]
|
38
|
+
def configuration
|
39
|
+
@configuration ||= Configuration.new
|
40
|
+
end
|
30
41
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
-
|
42
|
-
|
43
|
-
|
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.
|
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-
|
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
|