snuffleupagus 0.2.2 → 0.3.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 +4 -4
- data/.github/workflows/test.yml +29 -0
- data/.rubocop.yml +7 -3
- data/CHANGELOG.md +14 -0
- data/Gemfile +7 -0
- data/LICENSE +21 -0
- data/lib/snuffleupagus/auth_token.rb +1 -1
- data/lib/snuffleupagus/version.rb +1 -1
- data/snuffleupagus.gemspec +8 -5
- data/spec/{snuffleupagus_spec.rb → snuffleupagus/auth_token_spec.rb} +9 -9
- metadata +15 -73
- data/.travis.yml +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0f98ff72084d4ba25ea4bfa6c54b116f164e288c85f078bba36c7184edb99ce
|
4
|
+
data.tar.gz: f6b5e1e61fa86ec5e283d0816a08de1863e57b1035b390969102380cd980d039
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19c93b218f0a606a9f2b4fdc46b5b480782cf31bb38f7f0ce017669de6667a8e0ff2788f3d33369131b0c064e070195c135d3fe4fad8d594d078233da8bb1135
|
7
|
+
data.tar.gz: 79beadaf365531b40d51b771f1bfb910f561a679ff1f6a786a67fe17040ce99c6972376b5c45a93e96a3d0b999cd5e71bdedfbd65af5964c40417cd459af53f8
|
@@ -0,0 +1,29 @@
|
|
1
|
+
name: Test Snuffleupagus Ruby gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [main]
|
6
|
+
pull_request:
|
7
|
+
branches: [main]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
ruby-version: ['3.0', '3.1', '3.2', '3.3']
|
15
|
+
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v2
|
18
|
+
|
19
|
+
- name: Set up Ruby
|
20
|
+
uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: ${{ matrix.ruby-version }}
|
23
|
+
bundler-cache: true
|
24
|
+
|
25
|
+
- name: Lint code - Rubocop
|
26
|
+
run: bundle exec rubocop
|
27
|
+
|
28
|
+
- name: Run tests
|
29
|
+
run: bundle exec rake
|
data/.rubocop.yml
CHANGED
@@ -1,10 +1,14 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rake
|
3
|
+
- rubocop-rspec
|
4
|
+
|
1
5
|
AllCops:
|
2
6
|
NewCops: enable
|
3
|
-
TargetRubyVersion:
|
7
|
+
TargetRubyVersion: 3.0
|
4
8
|
|
5
9
|
Metrics/BlockLength:
|
6
10
|
Exclude:
|
7
11
|
- 'spec/**/*'
|
8
12
|
|
9
|
-
|
10
|
-
|
13
|
+
RSpec/NestedGroups:
|
14
|
+
Max: 4
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,20 @@
|
|
3
3
|
## Unreleased
|
4
4
|
- none
|
5
5
|
|
6
|
+
## [0.3.2](releases/tag/v0.3.2) - 2024-04-28
|
7
|
+
### Added
|
8
|
+
- Add support for Ruby 3.2 and 3.3 (#4)
|
9
|
+
|
10
|
+
## [0.3.1](releases/tag/v0.3.1) - 2022-08-19
|
11
|
+
### Added
|
12
|
+
- Add support for Ruby 3.1 (#3)
|
13
|
+
### Updated
|
14
|
+
- Use Github actions in favour of Travis CI (#3)
|
15
|
+
|
16
|
+
## [0.2.2](releases/tag/v0.2.2) - 2021-12-22
|
17
|
+
### Added
|
18
|
+
- Add support for Ruby 3.0 (#2)
|
19
|
+
|
6
20
|
## [0.1.1](releases/tag/v0.1.1) - 2020-10-21
|
7
21
|
### Updated
|
8
22
|
- Use named parameters when creating and validating tokens
|
data/Gemfile
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022 Studiosity
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/snuffleupagus.gemspec
CHANGED
@@ -9,15 +9,18 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.authors = ['Andrew Bromwich']
|
10
10
|
s.email = ['abromwich@studiosity.com']
|
11
11
|
s.homepage = 'https://github.com/Studiosity/snuffleupagus'
|
12
|
+
s.license = 'MIT'
|
12
13
|
s.description = 'Simple auth token generator/validator'
|
13
14
|
s.summary = "snuffleupagus-#{s.version}"
|
14
15
|
s.required_rubygems_version = '> 1.3.6'
|
15
|
-
s.required_ruby_version = ['>=
|
16
|
+
s.required_ruby_version = ['>= 3.0.0', '< 3.4.0']
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
19
|
+
# delete this section to allow pushing this gem to any host.
|
20
|
+
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' unless s.respond_to?(:metadata)
|
21
|
+
|
22
|
+
s.metadata['allowed_push_host'] = 'https://rubygems.org'
|
23
|
+
s.metadata['rubygems_mfa_required'] = 'true'
|
21
24
|
|
22
25
|
s.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
|
23
26
|
s.executables = `git ls-files`.split("\n").map do |f|
|
@@ -4,18 +4,18 @@ require './lib/snuffleupagus'
|
|
4
4
|
require 'timecop'
|
5
5
|
|
6
6
|
describe Snuffleupagus::AuthToken do
|
7
|
-
let(:snuffy) {
|
7
|
+
let(:snuffy) { described_class.new('sup3r4w3s0m3p4ssw0rd') }
|
8
8
|
|
9
9
|
describe '#create_token' do
|
10
|
-
subject { snuffy.create_token context: 'my-context' }
|
10
|
+
subject(:create_token) { snuffy.create_token context: 'my-context' }
|
11
11
|
|
12
12
|
it { is_expected.to be_a String }
|
13
|
-
it { expect(
|
13
|
+
it { expect(create_token.length).to eq 96 }
|
14
14
|
it { is_expected.to match(/\A[a-f0-9]{96}\z/) }
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#token_valid?' do
|
18
|
-
subject { snuffy.token_valid?(token: token, context: 'my-context') }
|
18
|
+
subject(:token_valid?) { snuffy.token_valid?(token: token, context: 'my-context') }
|
19
19
|
|
20
20
|
context 'with a valid token' do
|
21
21
|
let(:token) { snuffy.create_token context: 'my-context' }
|
@@ -47,31 +47,31 @@ describe Snuffleupagus::AuthToken do
|
|
47
47
|
it { is_expected.to be_falsey }
|
48
48
|
end
|
49
49
|
|
50
|
-
context '
|
50
|
+
context 'with an expired token' do
|
51
51
|
let(:token) { snuffy.create_token context: 'my-context' }
|
52
52
|
|
53
53
|
before { token } # pre-load the token
|
54
54
|
after { Timecop.return }
|
55
55
|
|
56
|
-
context 'just inside the time difference (expired token)' do
|
56
|
+
context 'when just inside the time difference (expired token)' do
|
57
57
|
before { Timecop.freeze Time.now - 119 }
|
58
58
|
|
59
59
|
it { is_expected.to be_truthy }
|
60
60
|
end
|
61
61
|
|
62
|
-
context 'just outside the time difference (expired token)' do
|
62
|
+
context 'when just outside the time difference (expired token)' do
|
63
63
|
before { Timecop.freeze Time.now - 120 }
|
64
64
|
|
65
65
|
it { is_expected.to be_falsey }
|
66
66
|
end
|
67
67
|
|
68
|
-
context 'just inside the time difference (future token)' do
|
68
|
+
context 'when just inside the time difference (future token)' do
|
69
69
|
before { Timecop.freeze Time.now + 119 }
|
70
70
|
|
71
71
|
it { is_expected.to be_truthy }
|
72
72
|
end
|
73
73
|
|
74
|
-
context 'just outside the time difference (future token)' do
|
74
|
+
context 'when just outside the time difference (future token)' do
|
75
75
|
before { Timecop.freeze Time.now + 120 }
|
76
76
|
|
77
77
|
it { is_expected.to be_falsey }
|
metadata
CHANGED
@@ -1,77 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snuffleupagus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Bromwich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rake
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '12.3'
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 12.3.3
|
23
|
-
type: :development
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '12.3'
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 12.3.3
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: rspec
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '3'
|
40
|
-
type: :development
|
41
|
-
prerelease: false
|
42
|
-
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- - "~>"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '3'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: rubocop
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0.49'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '0.49'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: timecop
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '0'
|
68
|
-
type: :development
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '0'
|
11
|
+
date: 2024-04-28 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
75
13
|
description: Simple auth token generator/validator
|
76
14
|
email:
|
77
15
|
- abromwich@studiosity.com
|
@@ -79,11 +17,12 @@ executables: []
|
|
79
17
|
extensions: []
|
80
18
|
extra_rdoc_files: []
|
81
19
|
files:
|
20
|
+
- ".github/workflows/test.yml"
|
82
21
|
- ".gitignore"
|
83
22
|
- ".rubocop.yml"
|
84
|
-
- ".travis.yml"
|
85
23
|
- CHANGELOG.md
|
86
24
|
- Gemfile
|
25
|
+
- LICENSE
|
87
26
|
- README.md
|
88
27
|
- Rakefile
|
89
28
|
- Snuffy.png
|
@@ -91,10 +30,13 @@ files:
|
|
91
30
|
- lib/snuffleupagus/auth_token.rb
|
92
31
|
- lib/snuffleupagus/version.rb
|
93
32
|
- snuffleupagus.gemspec
|
94
|
-
- spec/
|
33
|
+
- spec/snuffleupagus/auth_token_spec.rb
|
95
34
|
homepage: https://github.com/Studiosity/snuffleupagus
|
96
|
-
licenses:
|
97
|
-
|
35
|
+
licenses:
|
36
|
+
- MIT
|
37
|
+
metadata:
|
38
|
+
allowed_push_host: https://rubygems.org
|
39
|
+
rubygems_mfa_required: 'true'
|
98
40
|
post_install_message:
|
99
41
|
rdoc_options: []
|
100
42
|
require_paths:
|
@@ -103,18 +45,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
45
|
requirements:
|
104
46
|
- - ">="
|
105
47
|
- !ruby/object:Gem::Version
|
106
|
-
version:
|
48
|
+
version: 3.0.0
|
107
49
|
- - "<"
|
108
50
|
- !ruby/object:Gem::Version
|
109
|
-
version: 3.
|
51
|
+
version: 3.4.0
|
110
52
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
53
|
requirements:
|
112
54
|
- - ">"
|
113
55
|
- !ruby/object:Gem::Version
|
114
56
|
version: 1.3.6
|
115
57
|
requirements: []
|
116
|
-
rubygems_version: 3.
|
58
|
+
rubygems_version: 3.3.7
|
117
59
|
signing_key:
|
118
60
|
specification_version: 4
|
119
|
-
summary: snuffleupagus-0.
|
61
|
+
summary: snuffleupagus-0.3.2
|
120
62
|
test_files: []
|