snuffleupagus 0.3.1 → 0.3.2
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 +1 -1
- data/.rubocop.yml +7 -3
- data/CHANGELOG.md +4 -0
- data/Gemfile +7 -0
- data/lib/snuffleupagus/version.rb +1 -1
- data/snuffleupagus.gemspec +1 -8
- data/spec/{snuffleupagus_spec.rb → snuffleupagus/auth_token_spec.rb} +9 -9
- metadata +7 -97
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
|
data/.github/workflows/test.yml
CHANGED
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
data/Gemfile
CHANGED
data/snuffleupagus.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.description = 'Simple auth token generator/validator'
|
14
14
|
s.summary = "snuffleupagus-#{s.version}"
|
15
15
|
s.required_rubygems_version = '> 1.3.6'
|
16
|
-
s.required_ruby_version = ['>=
|
16
|
+
s.required_ruby_version = ['>= 3.0.0', '< 3.4.0']
|
17
17
|
|
18
18
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
19
19
|
# delete this section to allow pushing this gem to any host.
|
@@ -22,13 +22,6 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.metadata['allowed_push_host'] = 'https://rubygems.org'
|
23
23
|
s.metadata['rubygems_mfa_required'] = 'true'
|
24
24
|
|
25
|
-
s.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
|
26
|
-
s.add_development_dependency 'rspec', '~> 3'
|
27
|
-
s.add_development_dependency 'rubocop', '~> 1.26'
|
28
|
-
s.add_development_dependency 'rubocop-rake', '~> 0.6'
|
29
|
-
s.add_development_dependency 'rubocop-rspec', '~> 2.9'
|
30
|
-
s.add_development_dependency 'timecop', '~> 0'
|
31
|
-
|
32
25
|
s.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
|
33
26
|
s.executables = `git ls-files`.split("\n").map do |f|
|
34
27
|
f =~ %r{^bin/(.*)} ? Regexp.last_match(1) : nil
|
@@ -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,105 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snuffleupagus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
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: '1.26'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '1.26'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: rubocop-rake
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '0.6'
|
68
|
-
type: :development
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '0.6'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: rubocop-rspec
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - "~>"
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '2.9'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - "~>"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '2.9'
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: timecop
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '0'
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '0'
|
11
|
+
date: 2024-04-28 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
103
13
|
description: Simple auth token generator/validator
|
104
14
|
email:
|
105
15
|
- abromwich@studiosity.com
|
@@ -120,7 +30,7 @@ files:
|
|
120
30
|
- lib/snuffleupagus/auth_token.rb
|
121
31
|
- lib/snuffleupagus/version.rb
|
122
32
|
- snuffleupagus.gemspec
|
123
|
-
- spec/
|
33
|
+
- spec/snuffleupagus/auth_token_spec.rb
|
124
34
|
homepage: https://github.com/Studiosity/snuffleupagus
|
125
35
|
licenses:
|
126
36
|
- MIT
|
@@ -135,10 +45,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
45
|
requirements:
|
136
46
|
- - ">="
|
137
47
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
48
|
+
version: 3.0.0
|
139
49
|
- - "<"
|
140
50
|
- !ruby/object:Gem::Version
|
141
|
-
version: 3.
|
51
|
+
version: 3.4.0
|
142
52
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
53
|
requirements:
|
144
54
|
- - ">"
|
@@ -148,5 +58,5 @@ requirements: []
|
|
148
58
|
rubygems_version: 3.3.7
|
149
59
|
signing_key:
|
150
60
|
specification_version: 4
|
151
|
-
summary: snuffleupagus-0.3.
|
61
|
+
summary: snuffleupagus-0.3.2
|
152
62
|
test_files: []
|