matic-jwt 1.2.1 → 1.3.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 +4 -4
- data/.github/workflows/check.yml +30 -0
- data/.github/workflows/release.yml +35 -0
- data/.rubocop.yml +13 -0
- data/Gemfile +15 -2
- data/Gemfile.lock +84 -29
- data/README.md +17 -9
- data/Rakefile +3 -1
- data/bin/console +4 -3
- data/lib/matic-jwt/authenticator.rb +3 -1
- data/lib/matic-jwt/generator.rb +2 -0
- data/lib/matic-jwt/grape/helper.rb +2 -0
- data/lib/matic-jwt/grape/middleware/auth.rb +3 -1
- data/lib/matic-jwt/grape/middleware/request.rb +9 -2
- data/lib/matic-jwt/version.rb +3 -1
- data/lib/matic-jwt.rb +7 -4
- data/matic-jwt.gemspec +11 -13
- metadata +13 -52
- data/.github/workflows/main.yml +0 -68
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bef43d5997312616f50b0e39f656703075265c86ac1164281a50546bec94b5eb
|
4
|
+
data.tar.gz: 6c08125febdd3c3dbc95af1c5e27fb61fa53bfca60074103341121ee3d7a2754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63b515139bb3f8833ecd58b6362af50d94f391e9c534946309e92c894ed4173fedf6d6b647cccd40b79f341b9cd9dc9002cc3992658cb2c6001c2ea991777d73
|
7
|
+
data.tar.gz: f383d8a8238c747a33350ab00968213620e022510c5c56a4ef719e6a141688fcbf068e2e739dfb40c7ab86ecd50290041b6d41c84d28f765c69c9c8339fd78a0
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: Check
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches: [ "master" ]
|
5
|
+
pull_request:
|
6
|
+
branches: [ "master" ]
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
check:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
ruby: [ '3.1', '3.4' ]
|
14
|
+
steps:
|
15
|
+
- name: Checkout
|
16
|
+
uses: actions/checkout@v4
|
17
|
+
|
18
|
+
- name: Set up Ruby
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
bundler-cache: true
|
23
|
+
|
24
|
+
- name: Run Rubocop
|
25
|
+
run: bundle exec rubocop
|
26
|
+
|
27
|
+
- name: Run specs
|
28
|
+
env:
|
29
|
+
COVERAGE: true
|
30
|
+
run: bundle exec rspec
|
@@ -0,0 +1,35 @@
|
|
1
|
+
name: Release to RubyGems
|
2
|
+
on:
|
3
|
+
release:
|
4
|
+
types: [published]
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
release:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
permissions:
|
10
|
+
id-token: write
|
11
|
+
contents: read
|
12
|
+
steps:
|
13
|
+
- name: Checkout
|
14
|
+
uses: actions/checkout@v4
|
15
|
+
- name: Set up Ruby
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: 3.1
|
19
|
+
bundler-cache: true
|
20
|
+
- name: Set version from release tag
|
21
|
+
run: |
|
22
|
+
VERSION="${{ github.event.release.tag_name }}"
|
23
|
+
if [[ ! $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
24
|
+
echo "❌ ERROR: Version '$VERSION' is not in valid x.y.z format"
|
25
|
+
echo "Expected format: 1.2.3 (three numbers separated by dots)"
|
26
|
+
exit 1
|
27
|
+
fi
|
28
|
+
echo "Setting version to: $VERSION"
|
29
|
+
find . -name "version.rb" -exec sed -i "s|VERSION = ['\"][^'\"]*['\"]|VERSION = \"$VERSION\"|g" {} \;
|
30
|
+
- name: Configure RubyGems Credentials
|
31
|
+
uses: rubygems/configure-rubygems-credentials@main
|
32
|
+
- name: Build Gem
|
33
|
+
run: gem build *.gemspec
|
34
|
+
- name: Push gem
|
35
|
+
run: gem push *.gem
|
data/.rubocop.yml
ADDED
data/Gemfile
CHANGED
@@ -1,6 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
|
-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
5
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
6
|
|
5
|
-
# Specify your gem's dependencies in matic-jwt.gemspec
|
6
7
|
gemspec
|
8
|
+
|
9
|
+
group :development, :test do
|
10
|
+
gem 'bundler'
|
11
|
+
gem 'rake'
|
12
|
+
gem 'rspec'
|
13
|
+
end
|
14
|
+
|
15
|
+
group :test do
|
16
|
+
gem 'rubocop'
|
17
|
+
gem 'rubocop-performance', require: false
|
18
|
+
gem 'rubocop-rspec', require: false
|
19
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -8,45 +8,100 @@ PATH
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (
|
11
|
+
activesupport (7.1.5.1)
|
12
|
+
base64
|
13
|
+
benchmark (>= 0.3)
|
14
|
+
bigdecimal
|
12
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
connection_pool (>= 2.2.5)
|
17
|
+
drb
|
18
|
+
i18n (>= 1.6, < 2)
|
19
|
+
logger (>= 1.4.2)
|
20
|
+
minitest (>= 5.1)
|
21
|
+
mutex_m
|
22
|
+
securerandom (>= 0.3)
|
23
|
+
tzinfo (~> 2.0)
|
24
|
+
ast (2.4.3)
|
25
|
+
base64 (0.3.0)
|
26
|
+
benchmark (0.4.1)
|
27
|
+
bigdecimal (3.2.0)
|
28
|
+
concurrent-ruby (1.3.5)
|
29
|
+
connection_pool (2.5.3)
|
30
|
+
diff-lcs (1.6.2)
|
31
|
+
drb (2.2.3)
|
32
|
+
i18n (1.14.7)
|
20
33
|
concurrent-ruby (~> 1.0)
|
34
|
+
json (2.13.2)
|
21
35
|
jwt (2.2.1)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
36
|
+
language_server-protocol (3.17.0.5)
|
37
|
+
lint_roller (1.1.0)
|
38
|
+
logger (1.7.0)
|
39
|
+
minitest (5.25.5)
|
40
|
+
mutex_m (0.3.0)
|
41
|
+
parallel (1.27.0)
|
42
|
+
parser (3.3.9.0)
|
43
|
+
ast (~> 2.4.1)
|
44
|
+
racc
|
45
|
+
prism (1.4.0)
|
46
|
+
racc (1.8.1)
|
47
|
+
rainbow (3.1.1)
|
48
|
+
rake (13.3.0)
|
49
|
+
regexp_parser (2.10.0)
|
50
|
+
rspec (3.13.1)
|
51
|
+
rspec-core (~> 3.13.0)
|
52
|
+
rspec-expectations (~> 3.13.0)
|
53
|
+
rspec-mocks (~> 3.13.0)
|
54
|
+
rspec-core (3.13.5)
|
55
|
+
rspec-support (~> 3.13.0)
|
56
|
+
rspec-expectations (3.13.5)
|
31
57
|
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
-
rspec-support (~> 3.
|
33
|
-
rspec-mocks (3.
|
58
|
+
rspec-support (~> 3.13.0)
|
59
|
+
rspec-mocks (3.13.5)
|
34
60
|
diff-lcs (>= 1.2.0, < 2.0)
|
35
|
-
rspec-support (~> 3.
|
36
|
-
rspec-support (3.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
61
|
+
rspec-support (~> 3.13.0)
|
62
|
+
rspec-support (3.13.4)
|
63
|
+
rubocop (1.79.0)
|
64
|
+
json (~> 2.3)
|
65
|
+
language_server-protocol (~> 3.17.0.2)
|
66
|
+
lint_roller (~> 1.1.0)
|
67
|
+
parallel (~> 1.10)
|
68
|
+
parser (>= 3.3.0.2)
|
69
|
+
rainbow (>= 2.2.2, < 4.0)
|
70
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
71
|
+
rubocop-ast (>= 1.46.0, < 2.0)
|
72
|
+
ruby-progressbar (~> 1.7)
|
73
|
+
tsort (>= 0.2.0)
|
74
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
75
|
+
rubocop-ast (1.46.0)
|
76
|
+
parser (>= 3.3.7.2)
|
77
|
+
prism (~> 1.4)
|
78
|
+
rubocop-performance (1.25.0)
|
79
|
+
lint_roller (~> 1.1)
|
80
|
+
rubocop (>= 1.75.0, < 2.0)
|
81
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
82
|
+
rubocop-rspec (3.6.0)
|
83
|
+
lint_roller (~> 1.1)
|
84
|
+
rubocop (~> 1.72, >= 1.72.1)
|
85
|
+
ruby-progressbar (1.13.0)
|
86
|
+
securerandom (0.4.1)
|
87
|
+
tsort (0.2.0)
|
88
|
+
tzinfo (2.0.6)
|
89
|
+
concurrent-ruby (~> 1.0)
|
90
|
+
unicode-display_width (3.1.4)
|
91
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
92
|
+
unicode-emoji (4.0.4)
|
41
93
|
|
42
94
|
PLATFORMS
|
43
95
|
ruby
|
44
96
|
|
45
97
|
DEPENDENCIES
|
46
|
-
bundler
|
98
|
+
bundler
|
47
99
|
matic-jwt!
|
48
|
-
rake
|
49
|
-
rspec
|
100
|
+
rake
|
101
|
+
rspec
|
102
|
+
rubocop
|
103
|
+
rubocop-performance
|
104
|
+
rubocop-rspec
|
50
105
|
|
51
106
|
BUNDLED WITH
|
52
|
-
|
107
|
+
2.5.4
|
data/README.md
CHANGED
@@ -27,31 +27,39 @@ Use `MaticJWT::Generator` to create JWT tokens or headers:
|
|
27
27
|
generator = MaticJWT::Generator.new
|
28
28
|
token = generator.token_for('my_client', 'my_super_secret', additional_payload: 'test')
|
29
29
|
header = generator.authentication_header_for('my_client', 'my_super_secret', user_id: 'test@localhost.com')
|
30
|
-
```
|
30
|
+
```
|
31
31
|
|
32
32
|
### With Grape
|
33
|
+
Register `jwt_auth` strategy
|
34
|
+
```ruby
|
35
|
+
Grape::Middleware::Auth::Strategies.add(
|
36
|
+
:jwt_auth,
|
37
|
+
MaticJWT::Grape::Middleware::Auth,
|
38
|
+
->(options) { [options] }
|
39
|
+
)
|
40
|
+
```
|
33
41
|
|
34
|
-
Use ```:jwt_auth``` strategy and
|
42
|
+
Use ```:jwt_auth``` strategy and define lambda to obtain secret for by client name.
|
35
43
|
```ruby
|
36
|
-
auth :jwt_auth,
|
37
|
-
|
38
|
-
}
|
44
|
+
auth :jwt_auth,
|
45
|
+
secret: -> (client_name) { ::ApiClient.find_by!(name: client_name).secret }
|
39
46
|
```
|
47
|
+
|
40
48
|
If you need to get any data from authentication payload use ::MaticJWT::Grape::Helper.
|
41
49
|
```ruby
|
42
50
|
module ApiHelper
|
43
51
|
include ::MaticJWT::Grape::Helper
|
44
|
-
|
52
|
+
|
45
53
|
def current_client
|
46
54
|
@current_client ||= ::ApiClient.find_by!(name: client_name)
|
47
55
|
end
|
48
|
-
|
56
|
+
|
49
57
|
private
|
50
|
-
|
58
|
+
|
51
59
|
def client_name
|
52
60
|
auth_payload['client_name']
|
53
61
|
end
|
54
|
-
end
|
62
|
+
end
|
55
63
|
```
|
56
64
|
|
57
65
|
## Development
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'matic/jwt'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "matic/jwt"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module MaticJWT
|
2
4
|
class Authenticator
|
3
5
|
def initialize(header, scheme: SCHEME)
|
@@ -20,7 +22,7 @@ module MaticJWT
|
|
20
22
|
private
|
21
23
|
|
22
24
|
def extract_token(header)
|
23
|
-
token = header&.slice(@scheme.length + 1..-1)
|
25
|
+
token = header&.slice((@scheme.length + 1)..-1)
|
24
26
|
validate_header_presence!(token)
|
25
27
|
token
|
26
28
|
end
|
data/lib/matic-jwt/generator.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module MaticJWT
|
2
4
|
module Grape
|
3
5
|
module Middleware
|
@@ -50,4 +52,4 @@ module MaticJWT
|
|
50
52
|
end
|
51
53
|
end
|
52
54
|
|
53
|
-
Grape::Middleware::Auth::Strategies.add(:jwt_auth,
|
55
|
+
Grape::Middleware::Auth::Strategies.add(:jwt_auth, MaticJWT::Grape::Middleware::Auth, ->(options) { [options] })
|
@@ -1,8 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module MaticJWT
|
2
4
|
module Grape
|
3
5
|
module Middleware
|
4
6
|
class Request
|
5
|
-
AUTHORIZATION_KEYS = %w[
|
7
|
+
AUTHORIZATION_KEYS = %w[
|
8
|
+
Authorization
|
9
|
+
HTTP_AUTHORIZATION
|
10
|
+
X-HTTP_AUTHORIZATION
|
11
|
+
X_HTTP_AUTHORIZATION
|
12
|
+
].freeze
|
6
13
|
|
7
14
|
def initialize(env)
|
8
15
|
@env = env
|
@@ -19,7 +26,7 @@ module MaticJWT
|
|
19
26
|
private
|
20
27
|
|
21
28
|
def auth_key
|
22
|
-
@
|
29
|
+
@auth_key ||= AUTHORIZATION_KEYS.detect { |key| @env.key?(key) }
|
23
30
|
end
|
24
31
|
end
|
25
32
|
end
|
data/lib/matic-jwt/version.rb
CHANGED
data/lib/matic-jwt.rb
CHANGED
@@ -1,18 +1,21 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support'
|
4
|
+
require 'active_support/core_ext'
|
2
5
|
require 'jwt'
|
3
6
|
|
4
7
|
require 'matic-jwt/authenticator'
|
5
8
|
require 'matic-jwt/generator'
|
6
9
|
require 'matic-jwt/version'
|
7
10
|
|
8
|
-
if Gem.loaded_specs.
|
11
|
+
if Gem.loaded_specs.key?('grape')
|
9
12
|
require 'matic-jwt/grape/helper'
|
10
13
|
require 'matic-jwt/grape/middleware/request'
|
11
14
|
require 'matic-jwt/grape/middleware/auth'
|
12
15
|
end
|
13
16
|
|
14
17
|
module MaticJWT
|
15
|
-
ALGORITHM = 'HS256'
|
18
|
+
ALGORITHM = 'HS256'
|
16
19
|
EXPIRATION = 1.minute
|
17
|
-
SCHEME = 'Bearer'
|
20
|
+
SCHEME = 'Bearer'
|
18
21
|
end
|
data/matic-jwt.gemspec
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
|
-
lib = File.expand_path('
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'matic-jwt/version'
|
5
6
|
|
@@ -10,28 +11,25 @@ Gem::Specification.new do |spec|
|
|
10
11
|
spec.email = ['ydanyliak@getmatic.com']
|
11
12
|
|
12
13
|
spec.summary = "Matic's JWT implementation"
|
13
|
-
spec.description = 'This gem contains specific implementation of JWT authentication
|
14
|
+
spec.description = 'This gem contains specific implementation of JWT authentication ' \
|
15
|
+
'to be used inside of Matic products.'
|
14
16
|
spec.homepage = 'https://github.com/matic-insurance/matic-jwt-wrapper'
|
15
17
|
|
16
18
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
17
19
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
20
|
+
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' unless spec.respond_to?(:metadata)
|
21
|
+
|
22
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
23
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
23
24
|
|
24
|
-
spec.files
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
25
26
|
f.match(%r{^(test|spec|features)/})
|
26
27
|
end
|
27
28
|
spec.bindir = 'exe'
|
28
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
30
|
spec.require_paths = ['lib']
|
31
|
+
spec.required_ruby_version = '>= 3.0'
|
30
32
|
|
31
|
-
spec.add_dependency 'jwt'
|
32
33
|
spec.add_dependency 'activesupport'
|
33
|
-
|
34
|
-
spec.add_development_dependency 'bundler', '~> 1.16'
|
35
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
36
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
34
|
+
spec.add_dependency 'jwt'
|
37
35
|
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matic-jwt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yurii Danyliak
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: jwt
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -38,48 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.16'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.16'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '13.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '13.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3.0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3.0'
|
83
41
|
description: This gem contains specific implementation of JWT authentication to be
|
84
42
|
used inside of Matic products.
|
85
43
|
email:
|
@@ -88,8 +46,10 @@ executables: []
|
|
88
46
|
extensions: []
|
89
47
|
extra_rdoc_files: []
|
90
48
|
files:
|
91
|
-
- ".github/workflows/
|
49
|
+
- ".github/workflows/check.yml"
|
50
|
+
- ".github/workflows/release.yml"
|
92
51
|
- ".gitignore"
|
52
|
+
- ".rubocop.yml"
|
93
53
|
- Gemfile
|
94
54
|
- Gemfile.lock
|
95
55
|
- LICENSE
|
@@ -109,7 +69,8 @@ homepage: https://github.com/matic-insurance/matic-jwt-wrapper
|
|
109
69
|
licenses: []
|
110
70
|
metadata:
|
111
71
|
allowed_push_host: https://rubygems.org
|
112
|
-
|
72
|
+
rubygems_mfa_required: 'true'
|
73
|
+
post_install_message:
|
113
74
|
rdoc_options: []
|
114
75
|
require_paths:
|
115
76
|
- lib
|
@@ -117,15 +78,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
78
|
requirements:
|
118
79
|
- - ">="
|
119
80
|
- !ruby/object:Gem::Version
|
120
|
-
version: '0'
|
81
|
+
version: '3.0'
|
121
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
83
|
requirements:
|
123
84
|
- - ">="
|
124
85
|
- !ruby/object:Gem::Version
|
125
86
|
version: '0'
|
126
87
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
128
|
-
signing_key:
|
88
|
+
rubygems_version: 3.3.27
|
89
|
+
signing_key:
|
129
90
|
specification_version: 4
|
130
91
|
summary: Matic's JWT implementation
|
131
92
|
test_files: []
|
data/.github/workflows/main.yml
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
name: ci
|
2
|
-
on:
|
3
|
-
push:
|
4
|
-
branches:
|
5
|
-
- master
|
6
|
-
pull_request:
|
7
|
-
branches:
|
8
|
-
- master
|
9
|
-
release:
|
10
|
-
types: [published]
|
11
|
-
|
12
|
-
jobs:
|
13
|
-
build:
|
14
|
-
runs-on: ubuntu-latest
|
15
|
-
strategy:
|
16
|
-
matrix:
|
17
|
-
ruby: [ '2.5.x', '2.6.x' ]
|
18
|
-
steps:
|
19
|
-
- name: Checkout
|
20
|
-
uses: actions/checkout@v1
|
21
|
-
- name: Cache dependencies
|
22
|
-
uses: actions/cache@v1
|
23
|
-
with:
|
24
|
-
path: vendor/bundle
|
25
|
-
key: ${{ runner.OS }}-ruby-${{ matrix.ruby }}
|
26
|
-
restore-keys: ${{ runner.OS }}-
|
27
|
-
|
28
|
-
- name: Set up Ruby
|
29
|
-
uses: actions/setup-ruby@v1
|
30
|
-
with:
|
31
|
-
ruby-version: ${{ matrix.ruby }}
|
32
|
-
- name: Set up Bundler
|
33
|
-
run: gem install bundler:1.14.5
|
34
|
-
- name: Set up Dependencies
|
35
|
-
run: bundle install --path vendor/bundle
|
36
|
-
- name: Run specs
|
37
|
-
run: bundle exec rspec
|
38
|
-
|
39
|
-
release:
|
40
|
-
runs-on: ubuntu-latest
|
41
|
-
needs: build
|
42
|
-
if: github.event_name == 'release' && github.event.action == 'published'
|
43
|
-
steps:
|
44
|
-
- name: Checkout
|
45
|
-
uses: actions/checkout@v1
|
46
|
-
|
47
|
-
- name: Set up Ruby
|
48
|
-
uses: actions/setup-ruby@v1
|
49
|
-
with:
|
50
|
-
ruby-version: 2.6.x
|
51
|
-
- name: Set up Bundler
|
52
|
-
run: gem install bundler:1.17.3
|
53
|
-
- name: Set up credentials
|
54
|
-
run: |
|
55
|
-
mkdir -p $HOME/.gem
|
56
|
-
touch $HOME/.gem/credentials
|
57
|
-
chmod 0600 $HOME/.gem/credentials
|
58
|
-
printf -- "---\n:rubygems_api_key: ${{secrets.RUBYGEMS_AUTH_TOKEN}}\n" > $HOME/.gem/credentials
|
59
|
-
|
60
|
-
- name: Get version
|
61
|
-
run: echo "${GITHUB_REF/refs\/tags\//}" > release.tag
|
62
|
-
- name: Set version
|
63
|
-
run: sed -i "s/0.0.0/$(<release.tag)/g" */**/version.rb
|
64
|
-
|
65
|
-
- name: Build gem
|
66
|
-
run: gem build *.gemspec
|
67
|
-
- name: Push gem
|
68
|
-
run: gem push *.gem
|