grape-jwt-authentication 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/documentation.yml +38 -0
- data/.github/workflows/test.yml +59 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +18 -8
- data/.yardopts +6 -0
- data/CHANGELOG.md +6 -0
- data/Dockerfile +29 -0
- data/Envfile +6 -0
- data/Makefile +135 -0
- data/README.md +4 -4
- data/Rakefile +64 -0
- data/config/docker/.bash_profile +3 -0
- data/config/docker/.bashrc +48 -0
- data/config/docker/.inputrc +17 -0
- data/docker-compose.yml +9 -0
- data/grape-jwt-authentication.gemspec +13 -8
- data/lib/grape/jwt/authentication/dependencies.rb +2 -1
- data/lib/grape/jwt/authentication/version.rb +1 -1
- metadata +146 -61
- data/.travis.yml +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c126007f446b7d7f10daf0885215c0b16178dbd1d69e25ab5fe9018543837bf1
|
4
|
+
data.tar.gz: 573da54a3db4806eae9a269ad473e2471ee121684b4bf1508aa384b251d0ee18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12f8f4ae5c3fb57ab2a9bd6eddeb24386912cd072373ed6da7ebbc314e08ecc52ba14ac264abacee4db926ad875747baaab583b66c3e2da26a1188707f724776
|
7
|
+
data.tar.gz: b20247d73f3d57ec3bddc780fe5a41dd77eca18011df859df6028bc1afb737053ef8d8f9d419a5e672ed0f908361488e6884e4cf3b8ae26e31d332f4e45e019c
|
@@ -0,0 +1,38 @@
|
|
1
|
+
name: Build Documentation
|
2
|
+
on:
|
3
|
+
repository_dispatch:
|
4
|
+
types: [documentation]
|
5
|
+
|
6
|
+
concurrency:
|
7
|
+
group: 'docs'
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
docs:
|
11
|
+
name: Build gem documentation
|
12
|
+
runs-on: ubuntu-20.04
|
13
|
+
timeout-minutes: 5
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
|
17
|
+
- name: Install the correct Ruby version
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: 2.5
|
21
|
+
bundler-cache: true
|
22
|
+
|
23
|
+
- name: Prepare the virtual environment
|
24
|
+
uses: hausgold/actions/ci@master
|
25
|
+
with:
|
26
|
+
clone_token: '${{ secrets.CLONE_TOKEN }}'
|
27
|
+
settings: '${{ github.repository }}'
|
28
|
+
target: ci/gem-test
|
29
|
+
|
30
|
+
- name: Build gem documentation
|
31
|
+
run: make docs
|
32
|
+
|
33
|
+
- name: Upload the code coverage report
|
34
|
+
run: coverage
|
35
|
+
|
36
|
+
- name: Add this job to the commit status
|
37
|
+
run: commit-status '${{ job.status }}'
|
38
|
+
if: always()
|
@@ -0,0 +1,59 @@
|
|
1
|
+
name: Test
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- '**'
|
6
|
+
schedule:
|
7
|
+
- cron: '0 0 * * MON'
|
8
|
+
|
9
|
+
concurrency:
|
10
|
+
group: '${{ github.ref }}'
|
11
|
+
cancel-in-progress: true
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
test:
|
15
|
+
name: 'Test the gem (Ruby ${{ matrix.ruby }})'
|
16
|
+
runs-on: ubuntu-20.04
|
17
|
+
timeout-minutes: 5
|
18
|
+
strategy:
|
19
|
+
fail-fast: false
|
20
|
+
matrix:
|
21
|
+
ruby: [2.4, 2.5, 2.6]
|
22
|
+
steps:
|
23
|
+
- uses: actions/checkout@v2
|
24
|
+
|
25
|
+
- name: Install the correct Ruby version
|
26
|
+
uses: ruby/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: ${{ matrix.ruby }}
|
29
|
+
bundler-cache: true
|
30
|
+
|
31
|
+
- name: Prepare the virtual environment
|
32
|
+
uses: hausgold/actions/ci@master
|
33
|
+
with:
|
34
|
+
clone_token: '${{ secrets.CLONE_TOKEN }}'
|
35
|
+
settings: '${{ github.repository }}'
|
36
|
+
target: ci/gem-test
|
37
|
+
|
38
|
+
- name: Run the gem tests
|
39
|
+
run: make test
|
40
|
+
|
41
|
+
- name: Upload the code coverage report
|
42
|
+
run: coverage
|
43
|
+
|
44
|
+
trigger-docs:
|
45
|
+
name: Trigger the documentation upload
|
46
|
+
runs-on: ubuntu-20.04
|
47
|
+
timeout-minutes: 2
|
48
|
+
needs: test
|
49
|
+
if: github.ref == 'refs/heads/master'
|
50
|
+
steps:
|
51
|
+
- name: Prepare the virtual environment
|
52
|
+
uses: hausgold/actions/ci@master
|
53
|
+
with:
|
54
|
+
clone_token: '${{ secrets.CLONE_TOKEN }}'
|
55
|
+
settings: '${{ github.repository }}'
|
56
|
+
target: ci/noop
|
57
|
+
|
58
|
+
- name: Trigger the documentation upload
|
59
|
+
run: workflow documentation
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -8,23 +8,20 @@ Documentation:
|
|
8
8
|
|
9
9
|
AllCops:
|
10
10
|
DisplayCopNames: true
|
11
|
-
TargetRubyVersion: 2.
|
11
|
+
TargetRubyVersion: 2.5
|
12
12
|
Exclude:
|
13
|
-
- db/schema.rb
|
14
13
|
- bin/**/*
|
15
|
-
-
|
16
|
-
- vendor/cache/**/*
|
17
|
-
- vendor/bundle/**/*
|
14
|
+
- vendor/**/*
|
18
15
|
- build/**/*
|
16
|
+
- gemfiles/**/*
|
19
17
|
|
20
18
|
Metrics/BlockLength:
|
21
19
|
Exclude:
|
22
|
-
# Because of the Grape DSL
|
23
|
-
- lib/**/*.rb
|
24
20
|
- Rakefile
|
25
|
-
-
|
21
|
+
- '*.gemspec'
|
26
22
|
- spec/**/*.rb
|
27
23
|
- '**/*.rake'
|
24
|
+
- doc/**/*.rb
|
28
25
|
|
29
26
|
# Document all the things.
|
30
27
|
Style/DocumentationMethod:
|
@@ -41,3 +38,16 @@ Lint/AmbiguousBlockAssociation:
|
|
41
38
|
# supported with the +with(hash_including)+ matchers
|
42
39
|
RSpec/MessageSpies:
|
43
40
|
EnforcedStyle: receive
|
41
|
+
|
42
|
+
# Because nesting makes sense here to group the feature tests
|
43
|
+
# more effective. This increases maintainability.
|
44
|
+
RSpec/NestedGroups:
|
45
|
+
Max: 4
|
46
|
+
|
47
|
+
# Disable regular Rails spec paths.
|
48
|
+
RSpec/FilePath:
|
49
|
+
Enabled: false
|
50
|
+
|
51
|
+
# Because we just implemented the ActiveRecord API.
|
52
|
+
Rails/SkipsModelValidations:
|
53
|
+
Enabled: false
|
data/.yardopts
ADDED
data/CHANGELOG.md
CHANGED
data/Dockerfile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
FROM hausgold/ruby:2.5
|
2
|
+
MAINTAINER Hermann Mayer <hermann.mayer@hausgold.de>
|
3
|
+
|
4
|
+
# Update system gem
|
5
|
+
RUN gem update --system
|
6
|
+
|
7
|
+
# Install system packages and the latest bundler
|
8
|
+
RUN apt-get update -yqqq && \
|
9
|
+
apt-get install -y \
|
10
|
+
build-essential locales sudo vim \
|
11
|
+
ca-certificates \
|
12
|
+
bash-completion inotify-tools && \
|
13
|
+
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && /usr/sbin/locale-gen && \
|
14
|
+
gem install bundler -v '~> 2.0' --no-document --no-prerelease && \
|
15
|
+
gem install bundler -v '~> 1.0' --no-document --no-prerelease
|
16
|
+
|
17
|
+
# Add new web user
|
18
|
+
RUN mkdir /app && \
|
19
|
+
adduser web --home /home/web --shell /bin/bash \
|
20
|
+
--disabled-password --gecos ""
|
21
|
+
COPY config/docker/* /home/web/
|
22
|
+
RUN chown web:web -R /app /home/web /usr/local/bundle && \
|
23
|
+
mkdir -p /home/web/.ssh
|
24
|
+
|
25
|
+
# Set the root password and grant root access to web
|
26
|
+
RUN echo 'root:root' | chpasswd
|
27
|
+
RUN echo 'web ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
28
|
+
|
29
|
+
WORKDIR /app
|
data/Envfile
ADDED
data/Makefile
ADDED
@@ -0,0 +1,135 @@
|
|
1
|
+
MAKEFLAGS += --warn-undefined-variables -j1
|
2
|
+
SHELL := bash
|
3
|
+
.SHELLFLAGS := -eu -o pipefail -c
|
4
|
+
.DEFAULT_GOAL := all
|
5
|
+
.DELETE_ON_ERROR:
|
6
|
+
.SUFFIXES:
|
7
|
+
.PHONY:
|
8
|
+
|
9
|
+
# Environment switches
|
10
|
+
MAKE_ENV ?= docker
|
11
|
+
COMPOSE_RUN_SHELL_FLAGS ?= --rm
|
12
|
+
|
13
|
+
# Directories
|
14
|
+
VENDOR_DIR ?= vendor/bundle
|
15
|
+
|
16
|
+
# Host binaries
|
17
|
+
AWK ?= awk
|
18
|
+
BASH ?= bash
|
19
|
+
COMPOSE ?= docker-compose
|
20
|
+
DOCKER ?= docker
|
21
|
+
GREP ?= grep
|
22
|
+
ID ?= id
|
23
|
+
MKDIR ?= mkdir
|
24
|
+
RM ?= rm
|
25
|
+
XARGS ?= xargs
|
26
|
+
|
27
|
+
# Container binaries
|
28
|
+
BUNDLE ?= bundle
|
29
|
+
GEM ?= gem
|
30
|
+
RAKE ?= rake
|
31
|
+
RUBOCOP ?= rubocop
|
32
|
+
YARD ?= yard
|
33
|
+
|
34
|
+
# Define a generic shell run wrapper
|
35
|
+
# $1 - The command to run
|
36
|
+
ifeq ($(MAKE_ENV),docker)
|
37
|
+
define run-shell
|
38
|
+
$(COMPOSE) run $(COMPOSE_RUN_SHELL_FLAGS) \
|
39
|
+
-e LANG=en_US.UTF-8 -e LANGUAGE=en_US.UTF-8 -e LC_ALL=en_US.UTF-8 \
|
40
|
+
-e HOME=/home/web -e BUNDLE_APP_CONFIG=/app/.bundle \
|
41
|
+
-u `$(ID) -u` test bash -c 'sleep 0.1; echo; $(1)'
|
42
|
+
endef
|
43
|
+
else ifeq ($(MAKE_ENV),baremetal)
|
44
|
+
define run-shell
|
45
|
+
$(1)
|
46
|
+
endef
|
47
|
+
endif
|
48
|
+
|
49
|
+
all:
|
50
|
+
# grape-jwt-authentication
|
51
|
+
#
|
52
|
+
# install Install the dependencies
|
53
|
+
# update Update the local Gemset dependencies
|
54
|
+
# clean Clean the dependencies
|
55
|
+
#
|
56
|
+
# test Run the whole test suite
|
57
|
+
# test-style Test the code styles
|
58
|
+
#
|
59
|
+
# docs Generate the Ruby documentation of the library
|
60
|
+
# stats Print the code statistics (library and test suite)
|
61
|
+
# notes Print all the notes from the code
|
62
|
+
# release Release a new Gem version (maintainers only)
|
63
|
+
#
|
64
|
+
# shell Run an interactive shell on the container
|
65
|
+
# shell-irb Run an interactive IRB shell on the container
|
66
|
+
|
67
|
+
install:
|
68
|
+
# Install the dependencies
|
69
|
+
@$(MKDIR) -p $(VENDOR_DIR)
|
70
|
+
@$(call run-shell,$(BUNDLE) check || $(BUNDLE) install --path $(VENDOR_DIR))
|
71
|
+
@$(call run-shell,GEM_HOME=vendor/bundle/ruby/$${RUBY_MAJOR}.0 \
|
72
|
+
$(GEM) install bundler -v "~> 1.0")
|
73
|
+
|
74
|
+
test: \
|
75
|
+
test-specs \
|
76
|
+
test-style
|
77
|
+
|
78
|
+
test-specs:
|
79
|
+
# Run the whole test suite
|
80
|
+
@$(call run-shell,$(BUNDLE) exec $(RAKE) stats spec)
|
81
|
+
|
82
|
+
test-style: \
|
83
|
+
test-style-ruby
|
84
|
+
|
85
|
+
test-style-ruby:
|
86
|
+
# Run the static code analyzer (rubocop)
|
87
|
+
@$(call run-shell,$(BUNDLE) exec $(RUBOCOP) -a)
|
88
|
+
|
89
|
+
clean:
|
90
|
+
# Clean the dependencies
|
91
|
+
@$(RM) -rf $(VENDOR_DIR)
|
92
|
+
@$(RM) -rf $(VENDOR_DIR)/Gemfile.lock
|
93
|
+
@$(RM) -rf pkg
|
94
|
+
@$(RM) -rf coverage
|
95
|
+
|
96
|
+
clean-containers:
|
97
|
+
# Clean running containers
|
98
|
+
ifeq ($(MAKE_ENV),docker)
|
99
|
+
@$(COMPOSE) down
|
100
|
+
endif
|
101
|
+
|
102
|
+
clean-images:
|
103
|
+
# Clean build images
|
104
|
+
ifeq ($(MAKE_ENV),docker)
|
105
|
+
@-$(DOCKER) images | $(GREP) rimless \
|
106
|
+
| $(AWK) '{ print $$3 }' \
|
107
|
+
| $(XARGS) -rn1 $(DOCKER) rmi -f
|
108
|
+
endif
|
109
|
+
|
110
|
+
distclean: clean clean-containers clean-images
|
111
|
+
|
112
|
+
shell:
|
113
|
+
# Run an interactive shell on the container
|
114
|
+
@$(call run-shell,$(BASH) -i)
|
115
|
+
|
116
|
+
shell-irb:
|
117
|
+
# Run an interactive IRB shell on the container
|
118
|
+
@$(call run-shell,bin/console)
|
119
|
+
|
120
|
+
docs:
|
121
|
+
# Build the API documentation
|
122
|
+
@$(call run-shell,$(BUNDLE) exec $(YARD) -q && \
|
123
|
+
$(BUNDLE) exec $(YARD) stats --list-undoc --compact)
|
124
|
+
|
125
|
+
notes:
|
126
|
+
# Print the code statistics (library and test suite)
|
127
|
+
@$(call run-shell,$(BUNDLE) exec $(RAKE) notes)
|
128
|
+
|
129
|
+
stats:
|
130
|
+
# Print all the notes from the code
|
131
|
+
@$(call run-shell,$(BUNDLE) exec $(RAKE) stats)
|
132
|
+
|
133
|
+
release:
|
134
|
+
# Release a new gem version
|
135
|
+
@$(BUNDLE) exec $(RAKE) release
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
![grape-jwt-authentication](doc/assets/project.svg)
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Continuous Integration](https://github.com/hausgold/grape-jwt-authentication/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/hausgold/grape-jwt-authentication/actions/workflows/test.yml)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/grape-jwt-authentication.svg)](https://badge.fury.io/rb/grape-jwt-authentication)
|
5
|
-
[![
|
6
|
-
[![Test
|
7
|
-
[![API docs](https://
|
5
|
+
[![Test Coverage](https://automate-api.hausgold.de/v1/coverage_reports/grape-jwt-authentication/coverage.svg)](https://knowledge.hausgold.de/coverage)
|
6
|
+
[![Test Ratio](https://automate-api.hausgold.de/v1/coverage_reports/grape-jwt-authentication/ratio.svg)](https://knowledge.hausgold.de/coverage)
|
7
|
+
[![API docs](https://automate-api.hausgold.de/v1/coverage_reports/grape-jwt-authentication/documentation.svg)](https://www.rubydoc.info/gems/grape-jwt-authentication)
|
8
8
|
|
9
9
|
This gem is dedicated to easily integrate a JWT authentication to your
|
10
10
|
[Grape](https://github.com/ruby-grape/grape) API. The real authentication
|
data/Rakefile
CHANGED
@@ -2,7 +2,71 @@
|
|
2
2
|
|
3
3
|
require 'bundler/gem_tasks'
|
4
4
|
require 'rspec/core/rake_task'
|
5
|
+
require 'rails/code_statistics'
|
6
|
+
require 'pp'
|
5
7
|
|
6
8
|
RSpec::Core::RakeTask.new(:spec)
|
7
9
|
|
8
10
|
task default: :spec
|
11
|
+
|
12
|
+
# Load some railties tasks
|
13
|
+
load 'rails/tasks/statistics.rake'
|
14
|
+
load 'rails/tasks/annotations.rake'
|
15
|
+
|
16
|
+
# Clear the default statistics directory constant
|
17
|
+
#
|
18
|
+
# rubocop:disable Style/MutableConstant because we define it
|
19
|
+
Object.send(:remove_const, :STATS_DIRECTORIES)
|
20
|
+
::STATS_DIRECTORIES = []
|
21
|
+
# rubocop:enable Style/MutableConstant
|
22
|
+
|
23
|
+
# Monkey patch the Rails +CodeStatistics+ class to support configurable
|
24
|
+
# patterns per path. This is reuqired to support top-level only file matches.
|
25
|
+
class CodeStatistics
|
26
|
+
DEFAULT_PATTERN = /^(?!\.).*?\.(rb|js|coffee|rake)$/.freeze
|
27
|
+
|
28
|
+
# Pass the possible +pattern+ argument down to the
|
29
|
+
# +calculate_directory_statistics+ method call.
|
30
|
+
def calculate_statistics
|
31
|
+
Hash[@pairs.map do |pair|
|
32
|
+
[pair.first, calculate_directory_statistics(*pair[1..-1])]
|
33
|
+
end]
|
34
|
+
end
|
35
|
+
|
36
|
+
# Match the pattern against the individual file name and the relative file
|
37
|
+
# path. This allows top-level only matches.
|
38
|
+
def calculate_directory_statistics(directory, pattern = DEFAULT_PATTERN)
|
39
|
+
stats = CodeStatisticsCalculator.new
|
40
|
+
|
41
|
+
Dir.foreach(directory) do |file_name|
|
42
|
+
path = "#{directory}/#{file_name}"
|
43
|
+
|
44
|
+
if File.directory?(path) && (/^\./ !~ file_name)
|
45
|
+
stats.add(calculate_directory_statistics(path, pattern))
|
46
|
+
elsif file_name =~ pattern || path =~ pattern
|
47
|
+
stats.add_by_file_path(path)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
stats
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Configure all code statistics directories
|
56
|
+
vendors = [
|
57
|
+
[:unshift, 'Top-levels', 'lib'],
|
58
|
+
[:unshift, 'Top-levels specs', 'spec/grape']
|
59
|
+
].reverse
|
60
|
+
|
61
|
+
vendors.each do |method, type, dir, pattern|
|
62
|
+
::STATS_DIRECTORIES.send(method, [type, dir, pattern].compact)
|
63
|
+
::CodeStatistics::TEST_TYPES << type if type.include? 'specs'
|
64
|
+
end
|
65
|
+
|
66
|
+
# Setup annotations
|
67
|
+
ENV['SOURCE_ANNOTATION_DIRECTORIES'] = 'spec,doc'
|
68
|
+
|
69
|
+
desc 'Enumerate all annotations'
|
70
|
+
task :notes do
|
71
|
+
SourceAnnotationExtractor.enumerate '@?OPTIMIZE|@?FIXME|@?TODO', tag: true
|
72
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# ~/.bashrc: executed by bash(1) for non-login shells.
|
2
|
+
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
3
|
+
# for examples
|
4
|
+
|
5
|
+
_GEM_PATHS=$(ls -d1 ${HOME}/.gem/ruby/*/bin 2>/dev/null | paste -sd ':')
|
6
|
+
_APP_PATHS=$(ls -d1 /app/vendor/bundle/ruby/*/bin 2>/dev/null | paste -sd ':')
|
7
|
+
|
8
|
+
export PATH="${_GEM_PATHS}:${_APP_PATHS}:${PATH}"
|
9
|
+
export PATH="/app/node_modules/.bin:${HOME}/.bin:/app/bin:${PATH}"
|
10
|
+
export MAKE_ENV=baremetal
|
11
|
+
|
12
|
+
# Disable the autostart of all supervisord units
|
13
|
+
sudo sed -i 's/autostart=.*/autostart=false/g' /etc/supervisor/conf.d/*
|
14
|
+
|
15
|
+
# Start the supervisord (empty, no units)
|
16
|
+
sudo supervisord >/dev/null 2>&1 &
|
17
|
+
|
18
|
+
# Wait for supervisord
|
19
|
+
while ! supervisorctl status >/dev/null 2>&1; do sleep 1; done
|
20
|
+
|
21
|
+
# Boot the mDNS stack
|
22
|
+
echo '# Start the mDNS stack'
|
23
|
+
sudo supervisorctl start dbus avahi
|
24
|
+
echo
|
25
|
+
|
26
|
+
function watch-make-test()
|
27
|
+
{
|
28
|
+
while [ 1 ]; do
|
29
|
+
inotifywait --quiet -r `pwd` -e close_write --format '%e -> %w%f'
|
30
|
+
make test
|
31
|
+
done
|
32
|
+
}
|
33
|
+
|
34
|
+
function watch-make()
|
35
|
+
{
|
36
|
+
while [ 1 ]; do
|
37
|
+
inotifywait --quiet -r `pwd` -e close_write --format '%e -> %w%f'
|
38
|
+
make $@
|
39
|
+
done
|
40
|
+
}
|
41
|
+
|
42
|
+
function watch-run()
|
43
|
+
{
|
44
|
+
while [ 1 ]; do
|
45
|
+
inotifywait --quiet -r `pwd` -e close_write --format '%e -> %w%f'
|
46
|
+
bash -c "$@"
|
47
|
+
done
|
48
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
|
2
|
+
"\e[1;5C": forward-word
|
3
|
+
"\e[1;5D": backward-word
|
4
|
+
"\e[5C": forward-word
|
5
|
+
"\e[5D": backward-word
|
6
|
+
"\e\e[C": forward-word
|
7
|
+
"\e\e[D": backward-word
|
8
|
+
|
9
|
+
# handle common Home/End escape codes
|
10
|
+
"\e[1~": beginning-of-line
|
11
|
+
"\e[4~": end-of-line
|
12
|
+
"\e[7~": beginning-of-line
|
13
|
+
"\e[8~": end-of-line
|
14
|
+
"\eOH": beginning-of-line
|
15
|
+
"\eOF": end-of-line
|
16
|
+
"\e[H": beginning-of-line
|
17
|
+
"\e[F": end-of-line
|
data/docker-compose.yml
ADDED
@@ -21,20 +21,25 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
|
+
spec.add_runtime_dependency 'activesupport', '>= 3.2.0'
|
25
|
+
spec.add_runtime_dependency 'grape', '~> 1.0'
|
26
|
+
spec.add_runtime_dependency 'httparty'
|
27
|
+
spec.add_runtime_dependency 'jwt', '~> 2.1'
|
28
|
+
spec.add_runtime_dependency 'keyless', '~> 1.0'
|
29
|
+
spec.add_runtime_dependency 'recursive-open-struct', '~> 1.0'
|
30
|
+
|
24
31
|
spec.add_development_dependency 'bundler', '>= 1.16', '< 3'
|
25
32
|
spec.add_development_dependency 'rack', '~> 2.0'
|
26
33
|
spec.add_development_dependency 'rack-test', '~> 0.8.2'
|
34
|
+
spec.add_development_dependency 'railties', '>= 4.2.0', '< 6.1'
|
27
35
|
spec.add_development_dependency 'rake', '~> 10.0'
|
28
36
|
spec.add_development_dependency 'rspec', '~> 3.9'
|
29
|
-
spec.add_development_dependency '
|
37
|
+
spec.add_development_dependency 'rubocop', '~> 0.63.1'
|
38
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.31'
|
39
|
+
spec.add_development_dependency 'simplecov', '< 0.18'
|
30
40
|
spec.add_development_dependency 'timecop', '~> 0.9.1'
|
31
41
|
spec.add_development_dependency 'vcr', '~> 3.0'
|
32
42
|
spec.add_development_dependency 'webmock', '~> 3.1'
|
33
|
-
|
34
|
-
spec.
|
35
|
-
spec.add_runtime_dependency 'grape', '~> 1.0'
|
36
|
-
spec.add_runtime_dependency 'httparty'
|
37
|
-
spec.add_runtime_dependency 'jwt', '~> 2.1'
|
38
|
-
spec.add_runtime_dependency 'recursive-open-struct', '~> 1.0'
|
39
|
-
spec.add_runtime_dependency 'keyless', '~> 1.0'
|
43
|
+
spec.add_development_dependency 'yard', '~> 0.9.18'
|
44
|
+
spec.add_development_dependency 'yard-activesupport-concern', '~> 0.0.1'
|
40
45
|
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
module Grape
|
4
4
|
module Jwt
|
5
|
+
# The Grape JWT authentication concern.
|
5
6
|
module Authentication
|
6
7
|
# Specifies which configuration keys are shared between keyless
|
7
8
|
# and grape-jwt-authentication, so that we can easily pass through
|
@@ -10,7 +11,7 @@ module Grape
|
|
10
11
|
authenticator rsa_public_key_url rsa_public_key_caching
|
11
12
|
rsa_public_key_expiration jwt_issuer jwt_beholder jwt_options
|
12
13
|
jwt_verification_key
|
13
|
-
]
|
14
|
+
].freeze
|
14
15
|
|
15
16
|
# (Re)configure our gem dependencies. We take care of setting up
|
16
17
|
# +Keyless+, which has been extracted from this gem.
|
metadata
CHANGED
@@ -1,15 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-jwt-authentication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hermann Mayer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.2.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: grape
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: httparty
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: jwt
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.1'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: keyless
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: recursive-open-struct
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.0'
|
13
97
|
- !ruby/object:Gem::Dependency
|
14
98
|
name: bundler
|
15
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,173 +143,165 @@ dependencies:
|
|
59
143
|
- !ruby/object:Gem::Version
|
60
144
|
version: 0.8.2
|
61
145
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
146
|
+
name: railties
|
63
147
|
requirement: !ruby/object:Gem::Requirement
|
64
148
|
requirements:
|
65
|
-
- - "
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '10.0'
|
68
|
-
type: :development
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
149
|
+
- - ">="
|
73
150
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
75
|
-
-
|
76
|
-
name: rspec
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - "~>"
|
151
|
+
version: 4.2.0
|
152
|
+
- - "<"
|
80
153
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
154
|
+
version: '6.1'
|
82
155
|
type: :development
|
83
156
|
prerelease: false
|
84
157
|
version_requirements: !ruby/object:Gem::Requirement
|
85
158
|
requirements:
|
86
|
-
- - "
|
159
|
+
- - ">="
|
87
160
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
161
|
+
version: 4.2.0
|
162
|
+
- - "<"
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '6.1'
|
89
165
|
- !ruby/object:Gem::Dependency
|
90
|
-
name:
|
166
|
+
name: rake
|
91
167
|
requirement: !ruby/object:Gem::Requirement
|
92
168
|
requirements:
|
93
169
|
- - "~>"
|
94
170
|
- !ruby/object:Gem::Version
|
95
|
-
version: '0
|
171
|
+
version: '10.0'
|
96
172
|
type: :development
|
97
173
|
prerelease: false
|
98
174
|
version_requirements: !ruby/object:Gem::Requirement
|
99
175
|
requirements:
|
100
176
|
- - "~>"
|
101
177
|
- !ruby/object:Gem::Version
|
102
|
-
version: '0
|
178
|
+
version: '10.0'
|
103
179
|
- !ruby/object:Gem::Dependency
|
104
|
-
name:
|
180
|
+
name: rspec
|
105
181
|
requirement: !ruby/object:Gem::Requirement
|
106
182
|
requirements:
|
107
183
|
- - "~>"
|
108
184
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
185
|
+
version: '3.9'
|
110
186
|
type: :development
|
111
187
|
prerelease: false
|
112
188
|
version_requirements: !ruby/object:Gem::Requirement
|
113
189
|
requirements:
|
114
190
|
- - "~>"
|
115
191
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
192
|
+
version: '3.9'
|
117
193
|
- !ruby/object:Gem::Dependency
|
118
|
-
name:
|
194
|
+
name: rubocop
|
119
195
|
requirement: !ruby/object:Gem::Requirement
|
120
196
|
requirements:
|
121
197
|
- - "~>"
|
122
198
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
199
|
+
version: 0.63.1
|
124
200
|
type: :development
|
125
201
|
prerelease: false
|
126
202
|
version_requirements: !ruby/object:Gem::Requirement
|
127
203
|
requirements:
|
128
204
|
- - "~>"
|
129
205
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
206
|
+
version: 0.63.1
|
131
207
|
- !ruby/object:Gem::Dependency
|
132
|
-
name:
|
208
|
+
name: rubocop-rspec
|
133
209
|
requirement: !ruby/object:Gem::Requirement
|
134
210
|
requirements:
|
135
211
|
- - "~>"
|
136
212
|
- !ruby/object:Gem::Version
|
137
|
-
version: '
|
213
|
+
version: '1.31'
|
138
214
|
type: :development
|
139
215
|
prerelease: false
|
140
216
|
version_requirements: !ruby/object:Gem::Requirement
|
141
217
|
requirements:
|
142
218
|
- - "~>"
|
143
219
|
- !ruby/object:Gem::Version
|
144
|
-
version: '
|
220
|
+
version: '1.31'
|
145
221
|
- !ruby/object:Gem::Dependency
|
146
|
-
name:
|
222
|
+
name: simplecov
|
147
223
|
requirement: !ruby/object:Gem::Requirement
|
148
224
|
requirements:
|
149
|
-
- - "
|
225
|
+
- - "<"
|
150
226
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
152
|
-
type: :
|
227
|
+
version: '0.18'
|
228
|
+
type: :development
|
153
229
|
prerelease: false
|
154
230
|
version_requirements: !ruby/object:Gem::Requirement
|
155
231
|
requirements:
|
156
|
-
- - "
|
232
|
+
- - "<"
|
157
233
|
- !ruby/object:Gem::Version
|
158
|
-
version:
|
234
|
+
version: '0.18'
|
159
235
|
- !ruby/object:Gem::Dependency
|
160
|
-
name:
|
236
|
+
name: timecop
|
161
237
|
requirement: !ruby/object:Gem::Requirement
|
162
238
|
requirements:
|
163
239
|
- - "~>"
|
164
240
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
166
|
-
type: :
|
241
|
+
version: 0.9.1
|
242
|
+
type: :development
|
167
243
|
prerelease: false
|
168
244
|
version_requirements: !ruby/object:Gem::Requirement
|
169
245
|
requirements:
|
170
246
|
- - "~>"
|
171
247
|
- !ruby/object:Gem::Version
|
172
|
-
version:
|
248
|
+
version: 0.9.1
|
173
249
|
- !ruby/object:Gem::Dependency
|
174
|
-
name:
|
250
|
+
name: vcr
|
175
251
|
requirement: !ruby/object:Gem::Requirement
|
176
252
|
requirements:
|
177
|
-
- - "
|
253
|
+
- - "~>"
|
178
254
|
- !ruby/object:Gem::Version
|
179
|
-
version: '0'
|
180
|
-
type: :
|
255
|
+
version: '3.0'
|
256
|
+
type: :development
|
181
257
|
prerelease: false
|
182
258
|
version_requirements: !ruby/object:Gem::Requirement
|
183
259
|
requirements:
|
184
|
-
- - "
|
260
|
+
- - "~>"
|
185
261
|
- !ruby/object:Gem::Version
|
186
|
-
version: '0'
|
262
|
+
version: '3.0'
|
187
263
|
- !ruby/object:Gem::Dependency
|
188
|
-
name:
|
264
|
+
name: webmock
|
189
265
|
requirement: !ruby/object:Gem::Requirement
|
190
266
|
requirements:
|
191
267
|
- - "~>"
|
192
268
|
- !ruby/object:Gem::Version
|
193
|
-
version: '
|
194
|
-
type: :
|
269
|
+
version: '3.1'
|
270
|
+
type: :development
|
195
271
|
prerelease: false
|
196
272
|
version_requirements: !ruby/object:Gem::Requirement
|
197
273
|
requirements:
|
198
274
|
- - "~>"
|
199
275
|
- !ruby/object:Gem::Version
|
200
|
-
version: '
|
276
|
+
version: '3.1'
|
201
277
|
- !ruby/object:Gem::Dependency
|
202
|
-
name:
|
278
|
+
name: yard
|
203
279
|
requirement: !ruby/object:Gem::Requirement
|
204
280
|
requirements:
|
205
281
|
- - "~>"
|
206
282
|
- !ruby/object:Gem::Version
|
207
|
-
version:
|
208
|
-
type: :
|
283
|
+
version: 0.9.18
|
284
|
+
type: :development
|
209
285
|
prerelease: false
|
210
286
|
version_requirements: !ruby/object:Gem::Requirement
|
211
287
|
requirements:
|
212
288
|
- - "~>"
|
213
289
|
- !ruby/object:Gem::Version
|
214
|
-
version:
|
290
|
+
version: 0.9.18
|
215
291
|
- !ruby/object:Gem::Dependency
|
216
|
-
name:
|
292
|
+
name: yard-activesupport-concern
|
217
293
|
requirement: !ruby/object:Gem::Requirement
|
218
294
|
requirements:
|
219
295
|
- - "~>"
|
220
296
|
- !ruby/object:Gem::Version
|
221
|
-
version:
|
222
|
-
type: :
|
297
|
+
version: 0.0.1
|
298
|
+
type: :development
|
223
299
|
prerelease: false
|
224
300
|
version_requirements: !ruby/object:Gem::Requirement
|
225
301
|
requirements:
|
226
302
|
- - "~>"
|
227
303
|
- !ruby/object:Gem::Version
|
228
|
-
version:
|
304
|
+
version: 0.0.1
|
229
305
|
description: A reusable Grape JWT authentication concern
|
230
306
|
email:
|
231
307
|
- hermann.mayer92@gmail.com
|
@@ -234,19 +310,28 @@ extensions: []
|
|
234
310
|
extra_rdoc_files: []
|
235
311
|
files:
|
236
312
|
- ".editorconfig"
|
313
|
+
- ".github/workflows/documentation.yml"
|
314
|
+
- ".github/workflows/test.yml"
|
237
315
|
- ".gitignore"
|
238
316
|
- ".rspec"
|
239
317
|
- ".rubocop.yml"
|
240
318
|
- ".simplecov"
|
241
|
-
- ".
|
319
|
+
- ".yardopts"
|
242
320
|
- CHANGELOG.md
|
321
|
+
- Dockerfile
|
322
|
+
- Envfile
|
243
323
|
- Gemfile
|
244
324
|
- LICENSE
|
325
|
+
- Makefile
|
245
326
|
- README.md
|
246
327
|
- Rakefile
|
247
328
|
- bin/console
|
248
329
|
- bin/setup
|
330
|
+
- config/docker/.bash_profile
|
331
|
+
- config/docker/.bashrc
|
332
|
+
- config/docker/.inputrc
|
249
333
|
- doc/assets/project.svg
|
334
|
+
- docker-compose.yml
|
250
335
|
- grape-jwt-authentication.gemspec
|
251
336
|
- lib/grape/jwt/authentication.rb
|
252
337
|
- lib/grape/jwt/authentication/configuration.rb
|
data/.travis.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
env:
|
2
|
-
global:
|
3
|
-
- CC_TEST_REPORTER_ID=ecb753423174dbd8e4aaf04fb62bf4ef9c2a54904ac49a33fdf2b908b3c5e5f3
|
4
|
-
|
5
|
-
sudo: false
|
6
|
-
language: ruby
|
7
|
-
rvm:
|
8
|
-
- 2.6
|
9
|
-
- 2.5
|
10
|
-
- 2.4
|
11
|
-
|
12
|
-
before_install: gem install bundler
|
13
|
-
|
14
|
-
before_script:
|
15
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
16
|
-
- chmod +x ./cc-test-reporter
|
17
|
-
- ./cc-test-reporter before-build
|
18
|
-
script: bundle exec rake
|
19
|
-
after_script:
|
20
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|