keyless 1.4.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -2
- data/.rubocop.yml +1 -1
- data/Appraisals +0 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile +1 -1
- data/gemfiles/rails_6.1.gemfile +1 -1
- data/gemfiles/rails_7.1.gemfile +1 -1
- data/keyless.gemspec +2 -1
- 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 +35 -24
- metadata +18 -5
- data/gemfiles/rails_5.2.gemfile +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbc95fbabb0cbdb850e0f0a7ec811a050df4a6f43d8c761ff2703312f355429a
|
4
|
+
data.tar.gz: 6b890ac7e7ee3e920567039b704d6dd6a23f7b31c8c2c9cf5409ad8cf95d00d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c2b57068e0513809930c46ae26d45d6ab3c8cc6a536444f4bb4ba641c5f8cacf476a7b1209afaa48077fe4ce5a523461122932ab9e7c6fd715d431df72058bd
|
7
|
+
data.tar.gz: 4faffaff2617f964018c6ff6f3dc4e54290b339d9a02cf38ee71836e7d615001ab998159e2a6667c6f3a3f26acda1851a5b6973fa1f956395b9b3a84f4b5c21c
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
data/Appraisals
CHANGED
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
data/gemfiles/rails_6.1.gemfile
CHANGED
data/gemfiles/rails_7.1.gemfile
CHANGED
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', '>=
|
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,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,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 '
|
12
|
-
require '
|
13
|
-
require '
|
14
|
-
require '
|
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
|
-
|
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
34
|
+
# Retrieve the current configuration object.
|
35
|
+
#
|
36
|
+
# @return [Configuration]
|
37
|
+
def configuration
|
38
|
+
@configuration ||= Configuration.new
|
39
|
+
end
|
30
40
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
-
|
42
|
-
|
43
|
-
|
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
|
+
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:
|
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: '
|
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: '
|
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
|
data/gemfiles/rails_5.2.gemfile
DELETED
@@ -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: "../"
|