tiddle 1.8.0 → 1.9.0
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/ruby.yml +8 -18
- data/.gitignore +2 -0
- data/.rubocop.yml +2 -62
- data/CHANGELOG.md +20 -0
- data/Dockerfile +1 -1
- data/docker-compose.yml +2 -1
- data/gemfiles/rails7.2.gemfile +8 -0
- data/gemfiles/rails8.0.gemfile +8 -0
- data/gemfiles/rails8.1.gemfile +8 -0
- data/lib/tiddle/strategy.rb +5 -1
- data/lib/tiddle/version.rb +1 -1
- data/spec/rails_app_active_record/db/migrate/20150217000000_create_tables.rb +1 -1
- data/spec/strategy_spec.rb +29 -0
- data/spec/support/backend.rb +1 -8
- data/tiddle.gemspec +4 -4
- metadata +21 -22
- data/gemfiles/rails5.2.gemfile +0 -7
- data/gemfiles/rails6.0.gemfile +0 -7
- data/gemfiles/rails6.1.gemfile +0 -7
- data/gemfiles/rails7.0.gemfile +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 733cfe571ca455e2268dc7c37fd02f5e385512360741dde7e0ec13cdd742b1d9
|
|
4
|
+
data.tar.gz: 6c13743e957f03ef2b808312e3803992a2043d882360b53b981a7212deeffd6c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 25a2bc2f0ce66488b7131470870b6af13095c2c4494ef04705bb09d7d725d1d2e927ac486d59515ce7e4edc9ae564bd530bf6eff7908ba47f73e076882f31808
|
|
7
|
+
data.tar.gz: f5845920961f94b7fd44d8e24b84f62fa70dd559b87f69502f6ba884bfa3a5b7154379cda71c5ceeb4f8415095ccee86a26ede52bfc42925ed68609e516c068f
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -12,26 +12,16 @@ jobs:
|
|
|
12
12
|
fail-fast: false
|
|
13
13
|
matrix:
|
|
14
14
|
gemfile:
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
- rails7.0
|
|
15
|
+
- rails7.2
|
|
16
|
+
- rails8.0
|
|
17
|
+
- rails8.1
|
|
19
18
|
ruby:
|
|
20
|
-
- "
|
|
21
|
-
- "3.
|
|
22
|
-
- "
|
|
19
|
+
- "3.3"
|
|
20
|
+
- "3.4"
|
|
21
|
+
- "4.0"
|
|
23
22
|
backend:
|
|
24
23
|
- active_record
|
|
25
24
|
- mongoid
|
|
26
|
-
exclude:
|
|
27
|
-
- gemfile: rails5.2
|
|
28
|
-
ruby: "3.0"
|
|
29
|
-
- gemfile: rails5.2
|
|
30
|
-
ruby: "3.1"
|
|
31
|
-
- gemfile: rails6.0
|
|
32
|
-
ruby: "3.1"
|
|
33
|
-
- gemfile: rails6.1
|
|
34
|
-
ruby: "3.1"
|
|
35
25
|
name: ${{ matrix.gemfile }}, ruby ${{ matrix.ruby }}, ${{ matrix.backend }}
|
|
36
26
|
runs-on: ubuntu-latest
|
|
37
27
|
env:
|
|
@@ -39,14 +29,14 @@ jobs:
|
|
|
39
29
|
BACKEND: ${{ matrix.backend }}
|
|
40
30
|
|
|
41
31
|
steps:
|
|
42
|
-
- uses: actions/checkout@
|
|
32
|
+
- uses: actions/checkout@v7
|
|
43
33
|
- name: Set up Ruby
|
|
44
34
|
uses: ruby/setup-ruby@v1
|
|
45
35
|
with:
|
|
46
36
|
bundler-cache: true
|
|
47
37
|
ruby-version: ${{ matrix.ruby }}
|
|
48
38
|
- name: Start MongoDB
|
|
49
|
-
uses: supercharge/mongodb-github-action@1.
|
|
39
|
+
uses: supercharge/mongodb-github-action@1.10.0
|
|
50
40
|
if: ${{ matrix.backend == 'mongoid' }}
|
|
51
41
|
- name: Run tests
|
|
52
42
|
run: |
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
AllCops:
|
|
2
|
-
TargetRubyVersion:
|
|
2
|
+
TargetRubyVersion: 3.3
|
|
3
3
|
Include:
|
|
4
4
|
- 'lib/**/*.rb'
|
|
5
5
|
- 'spec/**/*.rb'
|
|
@@ -8,6 +8,7 @@ AllCops:
|
|
|
8
8
|
- 'spec/spec_helper.rb'
|
|
9
9
|
- 'vendor/bundle/**/*'
|
|
10
10
|
SuggestExtensions: false
|
|
11
|
+
NewCops: enable
|
|
11
12
|
Style/StringLiterals:
|
|
12
13
|
Enabled: false
|
|
13
14
|
Style/Documentation:
|
|
@@ -25,64 +26,3 @@ Metrics/BlockLength:
|
|
|
25
26
|
- 'spec/**/*'
|
|
26
27
|
Metrics/MethodLength:
|
|
27
28
|
Max: 15
|
|
28
|
-
|
|
29
|
-
Gemspec/DeprecatedAttributeAssignment:
|
|
30
|
-
Enabled: true
|
|
31
|
-
Layout/SpaceBeforeBrackets:
|
|
32
|
-
Enabled: true
|
|
33
|
-
Lint/AmbiguousAssignment:
|
|
34
|
-
Enabled: true
|
|
35
|
-
Lint/DeprecatedConstants:
|
|
36
|
-
Enabled: true
|
|
37
|
-
Lint/DuplicateBranch:
|
|
38
|
-
Enabled: true
|
|
39
|
-
Lint/DuplicateRegexpCharacterClassElement:
|
|
40
|
-
Enabled: true
|
|
41
|
-
Lint/EmptyBlock:
|
|
42
|
-
Enabled: true
|
|
43
|
-
Lint/EmptyClass:
|
|
44
|
-
Enabled: true
|
|
45
|
-
Lint/LambdaWithoutLiteralBlock:
|
|
46
|
-
Enabled: true
|
|
47
|
-
Lint/NoReturnInBeginEndBlocks:
|
|
48
|
-
Enabled: true
|
|
49
|
-
Lint/NumberedParameterAssignment:
|
|
50
|
-
Enabled: true
|
|
51
|
-
Lint/OrAssignmentToConstant:
|
|
52
|
-
Enabled: true
|
|
53
|
-
Lint/RedundantDirGlobSort:
|
|
54
|
-
Enabled: true
|
|
55
|
-
Lint/SymbolConversion:
|
|
56
|
-
Enabled: true
|
|
57
|
-
Lint/ToEnumArguments:
|
|
58
|
-
Enabled: true
|
|
59
|
-
Lint/TripleQuotes:
|
|
60
|
-
Enabled: true
|
|
61
|
-
Lint/UnexpectedBlockArity:
|
|
62
|
-
Enabled: true
|
|
63
|
-
Lint/UnmodifiedReduceAccumulator:
|
|
64
|
-
Enabled: true
|
|
65
|
-
Style/ArgumentsForwarding:
|
|
66
|
-
Enabled: true
|
|
67
|
-
Style/CollectionCompact:
|
|
68
|
-
Enabled: true
|
|
69
|
-
Style/DocumentDynamicEvalDefinition:
|
|
70
|
-
Enabled: true
|
|
71
|
-
Style/EndlessMethod:
|
|
72
|
-
Enabled: true
|
|
73
|
-
Style/HashConversion:
|
|
74
|
-
Enabled: true
|
|
75
|
-
Style/HashExcept:
|
|
76
|
-
Enabled: true
|
|
77
|
-
Style/IfWithBooleanLiteralBranches:
|
|
78
|
-
Enabled: true
|
|
79
|
-
Style/NegatedIfElseCondition:
|
|
80
|
-
Enabled: true
|
|
81
|
-
Style/NilLambda:
|
|
82
|
-
Enabled: true
|
|
83
|
-
Style/RedundantArgument:
|
|
84
|
-
Enabled: true
|
|
85
|
-
Style/StringChars:
|
|
86
|
-
Enabled: true
|
|
87
|
-
Style/SwapValues:
|
|
88
|
-
Enabled: true
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
### 1.9.0
|
|
2
|
+
|
|
3
|
+
Minimum supported ruby version is now 3.3 (André Piske)
|
|
4
|
+
|
|
5
|
+
Minimum supported Rails version is now 7.2 (André Piske)
|
|
6
|
+
|
|
7
|
+
Relax devise dependency to >= 4, < 6, thus supporting devise 5 (André Piske)
|
|
8
|
+
|
|
9
|
+
Support Devise config.authentication_keys in hash format (Arek W)
|
|
10
|
+
|
|
11
|
+
### 1.8.1
|
|
12
|
+
|
|
13
|
+
Remove Rails 5.2 and 6.0 support
|
|
14
|
+
|
|
15
|
+
Remove Ruby 2.7 support
|
|
16
|
+
|
|
17
|
+
Add Rails 7.1 support
|
|
18
|
+
|
|
19
|
+
Add Ruby 3.2 and 3.3 support
|
|
20
|
+
|
|
1
21
|
### 1.8.0
|
|
2
22
|
|
|
3
23
|
Support different touch interval based on expiration time (Daniel André da Silva)
|
data/Dockerfile
CHANGED
data/docker-compose.yml
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
version: "3.9"
|
|
2
2
|
services:
|
|
3
3
|
library:
|
|
4
|
+
platform: linux/x86_64
|
|
4
5
|
build:
|
|
5
6
|
context: .
|
|
6
7
|
stdin_open: true
|
|
@@ -12,7 +13,7 @@ services:
|
|
|
12
13
|
- redis
|
|
13
14
|
environment:
|
|
14
15
|
- REDIS_URL=redis://redis:6379/1
|
|
15
|
-
- BUNDLE_GEMFILE=gemfiles/
|
|
16
|
+
- BUNDLE_GEMFILE=gemfiles/rails8.1.gemfile
|
|
16
17
|
redis:
|
|
17
18
|
image: "redis:6-alpine"
|
|
18
19
|
command: redis-server
|
data/lib/tiddle/strategy.rb
CHANGED
|
@@ -53,7 +53,11 @@ module Devise
|
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
def authentication_keys
|
|
56
|
-
mapping.to.authentication_keys
|
|
56
|
+
if mapping.to.authentication_keys.is_a?(Hash)
|
|
57
|
+
mapping.to.authentication_keys.keys
|
|
58
|
+
else
|
|
59
|
+
mapping.to.authentication_keys
|
|
60
|
+
end
|
|
57
61
|
end
|
|
58
62
|
|
|
59
63
|
def touch_token(token)
|
data/lib/tiddle/version.rb
CHANGED
data/spec/strategy_spec.rb
CHANGED
|
@@ -181,6 +181,35 @@ describe "Authentication using Tiddle strategy", type: :request do
|
|
|
181
181
|
end
|
|
182
182
|
end
|
|
183
183
|
|
|
184
|
+
describe "when authentication_keys is a hash" do
|
|
185
|
+
before do
|
|
186
|
+
Devise.setup do |config|
|
|
187
|
+
config.authentication_keys = { email: true }
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
@user = User.create!(
|
|
191
|
+
email: "test@example.com",
|
|
192
|
+
password: "12345678"
|
|
193
|
+
)
|
|
194
|
+
@token = Tiddle.create_and_return_token(@user, FakeRequest.new)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
after do
|
|
198
|
+
Devise.setup do |config|
|
|
199
|
+
config.authentication_keys = [:email]
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
it "allows to access endpoints which require authentication with valid \
|
|
204
|
+
nick name and token" do
|
|
205
|
+
get(
|
|
206
|
+
secrets_path,
|
|
207
|
+
headers: { "X-USER-EMAIL" => "test@example.com", "X-USER-TOKEN" => @token }
|
|
208
|
+
)
|
|
209
|
+
expect(response.status).to eq 200
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
|
|
184
213
|
context "when token has expires_in set up" do
|
|
185
214
|
before do
|
|
186
215
|
@user = User.create!(email: "test@example.com", password: "12345678")
|
data/spec/support/backend.rb
CHANGED
|
@@ -23,14 +23,7 @@ module Backend
|
|
|
23
23
|
# Do initial migration
|
|
24
24
|
path = File.expand_path("../rails_app_active_record/db/migrate/", File.dirname(__FILE__))
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
ActiveRecord::MigrationContext.new(
|
|
28
|
-
path,
|
|
29
|
-
ActiveRecord::SchemaMigration
|
|
30
|
-
).migrate
|
|
31
|
-
else
|
|
32
|
-
ActiveRecord::MigrationContext.new(path).migrate
|
|
33
|
-
end
|
|
26
|
+
ActiveRecord::MigrationContext.new(path).migrate
|
|
34
27
|
end
|
|
35
28
|
end
|
|
36
29
|
|
data/tiddle.gemspec
CHANGED
|
@@ -16,11 +16,11 @@ Gem::Specification.new do |spec|
|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
17
17
|
spec.require_paths = ["lib"]
|
|
18
18
|
|
|
19
|
-
spec.required_ruby_version = '>=
|
|
19
|
+
spec.required_ruby_version = '>= 3.3.0'
|
|
20
20
|
|
|
21
|
-
spec.add_dependency "devise", ">= 4.
|
|
22
|
-
spec.add_dependency "activerecord", ">=
|
|
23
|
-
spec.add_development_dependency "rake"
|
|
21
|
+
spec.add_dependency "devise", ">= 4.7", "< 6"
|
|
22
|
+
spec.add_dependency "activerecord", ">= 7.2.0"
|
|
23
|
+
spec.add_development_dependency "rake", "~> 13"
|
|
24
24
|
spec.add_development_dependency "rspec-rails"
|
|
25
25
|
spec.add_development_dependency "simplecov"
|
|
26
26
|
spec.add_development_dependency "rubocop"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tiddle
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Niedzielski
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-07-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: devise
|
|
@@ -16,48 +16,48 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 4.
|
|
19
|
+
version: '4.7'
|
|
20
20
|
- - "<"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: '
|
|
22
|
+
version: '6'
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
27
|
- - ">="
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: 4.
|
|
29
|
+
version: '4.7'
|
|
30
30
|
- - "<"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '6'
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
34
|
name: activerecord
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version:
|
|
39
|
+
version: 7.2.0
|
|
40
40
|
type: :runtime
|
|
41
41
|
prerelease: false
|
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
44
|
- - ">="
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version:
|
|
46
|
+
version: 7.2.0
|
|
47
47
|
- !ruby/object:Gem::Dependency
|
|
48
48
|
name: rake
|
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
|
-
- - "
|
|
51
|
+
- - "~>"
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '
|
|
53
|
+
version: '13'
|
|
54
54
|
type: :development
|
|
55
55
|
prerelease: false
|
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
|
57
57
|
requirements:
|
|
58
|
-
- - "
|
|
58
|
+
- - "~>"
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '
|
|
60
|
+
version: '13'
|
|
61
61
|
- !ruby/object:Gem::Dependency
|
|
62
62
|
name: rspec-rails
|
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -128,7 +128,7 @@ dependencies:
|
|
|
128
128
|
- - ">="
|
|
129
129
|
- !ruby/object:Gem::Version
|
|
130
130
|
version: '0'
|
|
131
|
-
description:
|
|
131
|
+
description:
|
|
132
132
|
email:
|
|
133
133
|
- adamsunday@gmail.com
|
|
134
134
|
executables: []
|
|
@@ -148,10 +148,9 @@ files:
|
|
|
148
148
|
- Rakefile
|
|
149
149
|
- config/locales/en.yml
|
|
150
150
|
- docker-compose.yml
|
|
151
|
-
- gemfiles/
|
|
152
|
-
- gemfiles/
|
|
153
|
-
- gemfiles/
|
|
154
|
-
- gemfiles/rails7.0.gemfile
|
|
151
|
+
- gemfiles/rails7.2.gemfile
|
|
152
|
+
- gemfiles/rails8.0.gemfile
|
|
153
|
+
- gemfiles/rails8.1.gemfile
|
|
155
154
|
- lib/tiddle.rb
|
|
156
155
|
- lib/tiddle/model.rb
|
|
157
156
|
- lib/tiddle/model_name.rb
|
|
@@ -197,7 +196,7 @@ homepage: ''
|
|
|
197
196
|
licenses:
|
|
198
197
|
- MIT
|
|
199
198
|
metadata: {}
|
|
200
|
-
post_install_message:
|
|
199
|
+
post_install_message:
|
|
201
200
|
rdoc_options: []
|
|
202
201
|
require_paths:
|
|
203
202
|
- lib
|
|
@@ -205,15 +204,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
205
204
|
requirements:
|
|
206
205
|
- - ">="
|
|
207
206
|
- !ruby/object:Gem::Version
|
|
208
|
-
version:
|
|
207
|
+
version: 3.3.0
|
|
209
208
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
209
|
requirements:
|
|
211
210
|
- - ">="
|
|
212
211
|
- !ruby/object:Gem::Version
|
|
213
212
|
version: '0'
|
|
214
213
|
requirements: []
|
|
215
|
-
rubygems_version: 3.
|
|
216
|
-
signing_key:
|
|
214
|
+
rubygems_version: 3.5.16
|
|
215
|
+
signing_key:
|
|
217
216
|
specification_version: 4
|
|
218
217
|
summary: Token authentication for Devise which supports multiple tokens per model
|
|
219
218
|
test_files:
|
data/gemfiles/rails5.2.gemfile
DELETED
data/gemfiles/rails6.0.gemfile
DELETED
data/gemfiles/rails6.1.gemfile
DELETED