keyless 1.0.1 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a742a4e768b944a62453aa8cc6d94e1afd138a5cd3d4059ed6f970ade717618d
4
- data.tar.gz: 0c8e5392cc8443b303ddbfe67672ca54a56462041d84e95e4adcbddbb66bbc78
3
+ metadata.gz: 2fd16c98d515436659a9719caeb4552f1426992f77b4a1b2bf2465ad90cbf115
4
+ data.tar.gz: ce0f9e63a8f37f73282be5692a22de88ce6cf8bcddfeb2fafc71015b54281989
5
5
  SHA512:
6
- metadata.gz: 23f6a2b71ce821364c0c66aed4f585c80e74a4412bf204a08f95b265ab3790eacea59dcb1d5e5c8496bf1d06f2b0cf0d32c162f7a824f34a79a9bb0124d3b41a
7
- data.tar.gz: fd1d10b84e31ca6eb624832a3c2426b2df9989fe9ceb14c1c5638d87c3673be66c0d6972c3f50bc0cbd6fb73dde677a01e82be8cecddf472c94a2ae644a79085
6
+ metadata.gz: 92c80c2e5b22db4bd178441cc406d7379f64f870be51909d11139a56a64b0c5497415af384088601fd8cefb19b0cacbc97a50881959a56a775de0375bc8ebc9b
7
+ data.tar.gz: 2c212d36f0fd05ba0a5cf7a315f873b752f7549c532f3e39c3f5e4489db28e6eeb9213a0f76c728e41a55ae08db66ccb9bc8ebbe94fb5a084cd4a05d31729336
@@ -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
@@ -6,7 +6,10 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /vendor/
10
+ /gemfiles/vendor/
9
11
  /Gemfile.lock
12
+ *.gemfile.lock
10
13
 
11
14
  # rspec failure tracking
12
15
  .rspec_status
data/.rubocop.yml CHANGED
@@ -8,21 +8,20 @@ Documentation:
8
8
 
9
9
  AllCops:
10
10
  DisplayCopNames: true
11
- TargetRubyVersion: 2.3
11
+ TargetRubyVersion: 2.5
12
12
  Exclude:
13
- - db/schema.rb
14
13
  - bin/**/*
15
- - db/migrate/**/*
16
- - vendor/cache/**/*
17
- - vendor/bundle/**/*
14
+ - vendor/**/*
18
15
  - build/**/*
16
+ - gemfiles/**/*
19
17
 
20
18
  Metrics/BlockLength:
21
19
  Exclude:
22
20
  - Rakefile
23
- - keyless.gemspec
21
+ - '*.gemspec'
24
22
  - spec/**/*.rb
25
23
  - '**/*.rake'
24
+ - doc/**/*.rb
26
25
 
27
26
  # Document all the things.
28
27
  Style/DocumentationMethod:
@@ -39,3 +38,16 @@ Lint/AmbiguousBlockAssociation:
39
38
  # supported with the +with(hash_including)+ matchers
40
39
  RSpec/MessageSpies:
41
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
@@ -0,0 +1,6 @@
1
+ --output-dir=doc/api
2
+ --plugin activesupport-concern
3
+ --markup=rdoc
4
+ -
5
+ README.md
6
+ lib/**/*.rb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 1.0.2
2
+
3
+ * Migrated to Github Actions
4
+ * Migrated to our own coverage reporting
5
+ * Added the code statistics to the test process
6
+
1
7
  ### 1.0.1
2
8
 
3
9
  * Renamed the Gem to `keyless`.
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
@@ -0,0 +1,6 @@
1
+ LANG=en_US.UTF-8
2
+ LANGUAGE=en_US.UTF-8
3
+ LC_ALL=en_US.UTF-8
4
+
5
+ # Just fix this, so Appraisals with Rails 4 are working fine
6
+ BUNDLER_VERSION=1.17.3
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
+ # Keyless
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,8 +1,10 @@
1
1
  ![keyless](doc/assets/project.svg)
2
2
 
3
- [![Build Status](https://travis-ci.com/hausgold/keyless.svg?branch=master)](https://travis-ci.com/hausgold/keyless)
3
+ [![Continuous Integration](https://github.com/hausgold/keyless/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/hausgold/keyless/actions/workflows/test.yml)
4
4
  [![Gem Version](https://badge.fury.io/rb/keyless.svg)](https://badge.fury.io/rb/keyless)
5
- [![API docs](https://img.shields.io/badge/docs-API-blue.svg)](https://www.rubydoc.info/gems/keyless)
5
+ [![Test Coverage](https://automate-api.hausgold.de/v1/coverage_reports/keyless/coverage.svg)](https://knowledge.hausgold.de/coverage)
6
+ [![Test Ratio](https://automate-api.hausgold.de/v1/coverage_reports/keyless/ratio.svg)](https://knowledge.hausgold.de/coverage)
7
+ [![API docs](https://automate-api.hausgold.de/v1/coverage_reports/keyless/documentation.svg)](https://www.rubydoc.info/gems/keyless)
6
8
 
7
9
  This gem is dedicated to easily integrate a JWT authentication to your
8
10
  ruby application. 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', %r{lib(/keyless)?/[^/]+\.rb$}],
58
+ [:unshift, 'Top-levels specs', 'spec', %r{spec/.*_spec\.rb$}]
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,3 @@
1
+ if [ -f ~/.bashrc ]; then
2
+ . ~/.bashrc
3
+ fi
@@ -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
@@ -0,0 +1,9 @@
1
+ version: "3"
2
+ services:
3
+ test:
4
+ build: .
5
+ env_file: Envfile
6
+ network_mode: bridge
7
+ working_dir: /app
8
+ volumes:
9
+ - .:/app
data/keyless.gemspec CHANGED
@@ -8,7 +8,9 @@ Gem::Specification.new do |spec|
8
8
  spec.name = 'keyless'
9
9
  spec.version = Keyless::VERSION
10
10
  spec.authors = ['Hermann Mayer', 'Christopher Mühl', 'Marcus Geißler']
11
- spec.email = ['hermann.mayer92@gmail.com', 'christopher@padarom.xyz', 'mg@hausgold.de']
11
+ spec.email = ['hermann.mayer92@gmail.com',
12
+ 'christopher@padarom.xyz',
13
+ 'mg@hausgold.de']
12
14
 
13
15
  spec.summary = 'A reusable JWT authentication helper'
14
16
  spec.description = 'A reusable JWT authentication helper'
@@ -21,16 +23,21 @@ Gem::Specification.new do |spec|
21
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
24
  spec.require_paths = ['lib']
23
25
 
26
+ spec.add_runtime_dependency 'activesupport', '>= 3.2.0'
27
+ spec.add_runtime_dependency 'httparty'
28
+ spec.add_runtime_dependency 'jwt', '~> 2.1'
29
+ spec.add_runtime_dependency 'recursive-open-struct', '~> 1.0'
30
+
24
31
  spec.add_development_dependency 'bundler', '>= 1.16', '< 3'
32
+ spec.add_development_dependency 'railties', '>= 4.2.0', '< 6.1'
25
33
  spec.add_development_dependency 'rake', '~> 10.0'
26
34
  spec.add_development_dependency 'rspec', '~> 3.0'
27
- spec.add_development_dependency 'simplecov', '~> 0.15'
35
+ spec.add_development_dependency 'rubocop', '~> 0.63.1'
36
+ spec.add_development_dependency 'rubocop-rspec', '~> 1.31'
37
+ spec.add_development_dependency 'simplecov', '< 0.18'
28
38
  spec.add_development_dependency 'timecop', '~> 0.9.1'
29
39
  spec.add_development_dependency 'vcr', '~> 3.0'
30
40
  spec.add_development_dependency 'webmock', '~> 3.1'
31
-
32
- spec.add_runtime_dependency 'activesupport', '>= 3.2.0'
33
- spec.add_runtime_dependency 'httparty'
34
- spec.add_runtime_dependency 'jwt', '~> 2.1'
35
- spec.add_runtime_dependency 'recursive-open-struct', '~> 1.0'
41
+ spec.add_development_dependency 'yard', '~> 0.9.18'
42
+ spec.add_development_dependency 'yard-activesupport-concern', '~> 0.0.1'
36
43
  end
@@ -65,7 +65,8 @@ module Keyless
65
65
 
66
66
  if remote?
67
67
  res = HTTParty.get(url)
68
- raise FetchError, res.inspect unless (200..299).include? res.code
68
+ raise FetchError, res.inspect unless (200..299).cover? res.code
69
+
69
70
  res.body
70
71
  else
71
72
  File.read(url)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Keyless
4
- VERSION = '1.0.1'.freeze
4
+ VERSION = '1.0.2'
5
5
  end
metadata CHANGED
@@ -1,17 +1,73 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keyless
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer
8
8
  - Christopher Mühl
9
9
  - Marcus Geißler
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-09-01 00:00:00.000000000 Z
13
+ date: 2021-10-15 00:00:00.000000000 Z
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activesupport
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 3.2.0
29
+ - !ruby/object:Gem::Dependency
30
+ name: httparty
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: jwt
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '2.1'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '2.1'
57
+ - !ruby/object:Gem::Dependency
58
+ name: recursive-open-struct
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '1.0'
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '1.0'
15
71
  - !ruby/object:Gem::Dependency
16
72
  name: bundler
17
73
  requirement: !ruby/object:Gem::Requirement
@@ -32,6 +88,26 @@ dependencies:
32
88
  - - "<"
33
89
  - !ruby/object:Gem::Version
34
90
  version: '3'
91
+ - !ruby/object:Gem::Dependency
92
+ name: railties
93
+ requirement: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: 4.2.0
98
+ - - "<"
99
+ - !ruby/object:Gem::Version
100
+ version: '6.1'
101
+ type: :development
102
+ prerelease: false
103
+ version_requirements: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: 4.2.0
108
+ - - "<"
109
+ - !ruby/object:Gem::Version
110
+ version: '6.1'
35
111
  - !ruby/object:Gem::Dependency
36
112
  name: rake
37
113
  requirement: !ruby/object:Gem::Requirement
@@ -61,117 +137,117 @@ dependencies:
61
137
  - !ruby/object:Gem::Version
62
138
  version: '3.0'
63
139
  - !ruby/object:Gem::Dependency
64
- name: simplecov
140
+ name: rubocop
65
141
  requirement: !ruby/object:Gem::Requirement
66
142
  requirements:
67
143
  - - "~>"
68
144
  - !ruby/object:Gem::Version
69
- version: '0.15'
145
+ version: 0.63.1
70
146
  type: :development
71
147
  prerelease: false
72
148
  version_requirements: !ruby/object:Gem::Requirement
73
149
  requirements:
74
150
  - - "~>"
75
151
  - !ruby/object:Gem::Version
76
- version: '0.15'
152
+ version: 0.63.1
77
153
  - !ruby/object:Gem::Dependency
78
- name: timecop
154
+ name: rubocop-rspec
79
155
  requirement: !ruby/object:Gem::Requirement
80
156
  requirements:
81
157
  - - "~>"
82
158
  - !ruby/object:Gem::Version
83
- version: 0.9.1
159
+ version: '1.31'
84
160
  type: :development
85
161
  prerelease: false
86
162
  version_requirements: !ruby/object:Gem::Requirement
87
163
  requirements:
88
164
  - - "~>"
89
165
  - !ruby/object:Gem::Version
90
- version: 0.9.1
166
+ version: '1.31'
91
167
  - !ruby/object:Gem::Dependency
92
- name: vcr
168
+ name: simplecov
93
169
  requirement: !ruby/object:Gem::Requirement
94
170
  requirements:
95
- - - "~>"
171
+ - - "<"
96
172
  - !ruby/object:Gem::Version
97
- version: '3.0'
173
+ version: '0.18'
98
174
  type: :development
99
175
  prerelease: false
100
176
  version_requirements: !ruby/object:Gem::Requirement
101
177
  requirements:
102
- - - "~>"
178
+ - - "<"
103
179
  - !ruby/object:Gem::Version
104
- version: '3.0'
180
+ version: '0.18'
105
181
  - !ruby/object:Gem::Dependency
106
- name: webmock
182
+ name: timecop
107
183
  requirement: !ruby/object:Gem::Requirement
108
184
  requirements:
109
185
  - - "~>"
110
186
  - !ruby/object:Gem::Version
111
- version: '3.1'
187
+ version: 0.9.1
112
188
  type: :development
113
189
  prerelease: false
114
190
  version_requirements: !ruby/object:Gem::Requirement
115
191
  requirements:
116
192
  - - "~>"
117
193
  - !ruby/object:Gem::Version
118
- version: '3.1'
194
+ version: 0.9.1
119
195
  - !ruby/object:Gem::Dependency
120
- name: activesupport
196
+ name: vcr
121
197
  requirement: !ruby/object:Gem::Requirement
122
198
  requirements:
123
- - - ">="
199
+ - - "~>"
124
200
  - !ruby/object:Gem::Version
125
- version: 3.2.0
126
- type: :runtime
201
+ version: '3.0'
202
+ type: :development
127
203
  prerelease: false
128
204
  version_requirements: !ruby/object:Gem::Requirement
129
205
  requirements:
130
- - - ">="
206
+ - - "~>"
131
207
  - !ruby/object:Gem::Version
132
- version: 3.2.0
208
+ version: '3.0'
133
209
  - !ruby/object:Gem::Dependency
134
- name: httparty
210
+ name: webmock
135
211
  requirement: !ruby/object:Gem::Requirement
136
212
  requirements:
137
- - - ">="
213
+ - - "~>"
138
214
  - !ruby/object:Gem::Version
139
- version: '0'
140
- type: :runtime
215
+ version: '3.1'
216
+ type: :development
141
217
  prerelease: false
142
218
  version_requirements: !ruby/object:Gem::Requirement
143
219
  requirements:
144
- - - ">="
220
+ - - "~>"
145
221
  - !ruby/object:Gem::Version
146
- version: '0'
222
+ version: '3.1'
147
223
  - !ruby/object:Gem::Dependency
148
- name: jwt
224
+ name: yard
149
225
  requirement: !ruby/object:Gem::Requirement
150
226
  requirements:
151
227
  - - "~>"
152
228
  - !ruby/object:Gem::Version
153
- version: '2.1'
154
- type: :runtime
229
+ version: 0.9.18
230
+ type: :development
155
231
  prerelease: false
156
232
  version_requirements: !ruby/object:Gem::Requirement
157
233
  requirements:
158
234
  - - "~>"
159
235
  - !ruby/object:Gem::Version
160
- version: '2.1'
236
+ version: 0.9.18
161
237
  - !ruby/object:Gem::Dependency
162
- name: recursive-open-struct
238
+ name: yard-activesupport-concern
163
239
  requirement: !ruby/object:Gem::Requirement
164
240
  requirements:
165
241
  - - "~>"
166
242
  - !ruby/object:Gem::Version
167
- version: '1.0'
168
- type: :runtime
243
+ version: 0.0.1
244
+ type: :development
169
245
  prerelease: false
170
246
  version_requirements: !ruby/object:Gem::Requirement
171
247
  requirements:
172
248
  - - "~>"
173
249
  - !ruby/object:Gem::Version
174
- version: '1.0'
250
+ version: 0.0.1
175
251
  description: A reusable JWT authentication helper
176
252
  email:
177
253
  - hermann.mayer92@gmail.com
@@ -182,19 +258,28 @@ extensions: []
182
258
  extra_rdoc_files: []
183
259
  files:
184
260
  - ".editorconfig"
261
+ - ".github/workflows/documentation.yml"
262
+ - ".github/workflows/test.yml"
185
263
  - ".gitignore"
186
264
  - ".rspec"
187
265
  - ".rubocop.yml"
188
266
  - ".simplecov"
189
- - ".travis.yml"
267
+ - ".yardopts"
190
268
  - CHANGELOG.md
269
+ - Dockerfile
270
+ - Envfile
191
271
  - Gemfile
192
272
  - LICENSE
273
+ - Makefile
193
274
  - README.md
194
275
  - Rakefile
195
276
  - bin/console
196
277
  - bin/setup
278
+ - config/docker/.bash_profile
279
+ - config/docker/.bashrc
280
+ - config/docker/.inputrc
197
281
  - doc/assets/project.svg
282
+ - docker-compose.yml
198
283
  - keyless.gemspec
199
284
  - lib/keyless.rb
200
285
  - lib/keyless/configuration.rb
@@ -204,7 +289,7 @@ files:
204
289
  homepage: https://github.com/hausgold/keyless
205
290
  licenses: []
206
291
  metadata: {}
207
- post_install_message:
292
+ post_install_message:
208
293
  rdoc_options: []
209
294
  require_paths:
210
295
  - lib
@@ -219,8 +304,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
304
  - !ruby/object:Gem::Version
220
305
  version: '0'
221
306
  requirements: []
222
- rubygems_version: 3.0.8
223
- signing_key:
307
+ rubygems_version: 3.2.16
308
+ signing_key:
224
309
  specification_version: 4
225
310
  summary: A reusable JWT authentication helper
226
311
  test_files: []
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