veri 2.0.1 → 2.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +27 -9
- data/lib/veri/configuration.rb +1 -1
- data/lib/veri/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c9b0db1fbb87c0a3b25d47f2142cab1b9143a0ba7751a05c1676ca6e3b4b6ee3
|
|
4
|
+
data.tar.gz: 600d600760a3c0af2fddfece43322193be1ae4255eae0dd1c22d4099a083cb7b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aaf5ec5aced9ddec1c42367df39be9e4322d3b1b3946bb473bfaee3f668d6fea55d78b48f3f1f0fa1acb8ee4588de8039d054730d3b913ab8036def74054d858
|
|
7
|
+
data.tar.gz: b188516f09afc341584f4460d5caa0e552c94e54dfe3a4bc3fe7a4cddb592acbb8c4957092e4763e88bd1be34ebc122934b40876bd2fc23e87d3b207b5fb2479
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -70,10 +70,14 @@ Configure Veri in an initializer if customization is needed:
|
|
|
70
70
|
```rb
|
|
71
71
|
# These are the default values; you can change them as needed
|
|
72
72
|
Veri.configure do |config|
|
|
73
|
-
|
|
74
|
-
config.
|
|
75
|
-
|
|
76
|
-
config.
|
|
73
|
+
# Password hashing algorithm (:argon2, :bcrypt, :pbkdf2, or :scrypt)
|
|
74
|
+
config.hashing_algorithm = :argon2
|
|
75
|
+
# Session inactivity timeout (nil means sessions never expire due to inactivity)
|
|
76
|
+
config.inactive_session_lifetime = nil
|
|
77
|
+
# Maximum session duration regardless of activity
|
|
78
|
+
config.total_session_lifetime = 14.days
|
|
79
|
+
# Your user model name
|
|
80
|
+
config.user_model_name = "User"
|
|
77
81
|
end
|
|
78
82
|
```
|
|
79
83
|
|
|
@@ -88,6 +92,12 @@ user.update_password("password")
|
|
|
88
92
|
# Verify a password
|
|
89
93
|
user.verify_password("password")
|
|
90
94
|
```
|
|
95
|
+
Changing a password does not automatically terminate existing sessions. If you want to invalidate the user's sessions after a password change, do so explicitly:
|
|
96
|
+
|
|
97
|
+
```rb
|
|
98
|
+
user.update_password(new_password)
|
|
99
|
+
user.sessions.terminate_all
|
|
100
|
+
```
|
|
91
101
|
|
|
92
102
|
## Controller Integration
|
|
93
103
|
|
|
@@ -99,11 +109,13 @@ Include the authentication module in your controllers and configure protection:
|
|
|
99
109
|
class ApplicationController < ActionController::Base
|
|
100
110
|
include Veri::Authentication
|
|
101
111
|
|
|
102
|
-
|
|
112
|
+
# Require authentication by default
|
|
113
|
+
with_authentication
|
|
103
114
|
end
|
|
104
115
|
|
|
105
116
|
class PicturesController < ApplicationController
|
|
106
|
-
|
|
117
|
+
# Allow public access to index and show actions
|
|
118
|
+
skip_authentication only: [:index, :show]
|
|
107
119
|
end
|
|
108
120
|
```
|
|
109
121
|
|
|
@@ -161,7 +173,7 @@ current_user
|
|
|
161
173
|
# Returns true if user is authenticated
|
|
162
174
|
logged_in?
|
|
163
175
|
|
|
164
|
-
# Authenticates user
|
|
176
|
+
# Authenticates user, returns true on success or false if account is locked
|
|
165
177
|
log_in(user)
|
|
166
178
|
|
|
167
179
|
# Terminates current session
|
|
@@ -408,6 +420,12 @@ To clean up orphaned sessions, use:
|
|
|
408
420
|
Veri::Session.prune
|
|
409
421
|
```
|
|
410
422
|
|
|
423
|
+
Or, for a specific user:
|
|
424
|
+
|
|
425
|
+
```rb
|
|
426
|
+
user.sessions.prune
|
|
427
|
+
```
|
|
428
|
+
|
|
411
429
|
### Tenant Migrations
|
|
412
430
|
|
|
413
431
|
When you rename or remove models used as tenants, you need to update Veri's stored data accordingly. Use these irreversible data migrations:
|
|
@@ -484,7 +502,7 @@ end
|
|
|
484
502
|
## Getting Help and Contributing
|
|
485
503
|
|
|
486
504
|
### Getting Help
|
|
487
|
-
Have a question or need assistance? Open a discussion in
|
|
505
|
+
Have a question or need assistance? Open a discussion in the [discussions section](https://github.com/enjaku4/veri/discussions) for:
|
|
488
506
|
- Usage questions
|
|
489
507
|
- Implementation guidance
|
|
490
508
|
- Feature suggestions
|
|
@@ -499,7 +517,7 @@ Found a bug? Please [create an issue](https://github.com/enjaku4/veri/issues) wi
|
|
|
499
517
|
Ready to contribute? You can:
|
|
500
518
|
- Fix bugs by submitting pull requests
|
|
501
519
|
- Improve documentation
|
|
502
|
-
- Add new features (please discuss first in
|
|
520
|
+
- Add new features (please discuss first in the [discussions section](https://github.com/enjaku4/veri/discussions))
|
|
503
521
|
|
|
504
522
|
Before contributing, please read the [contributing guidelines](https://github.com/enjaku4/veri/blob/main/CONTRIBUTING.md)
|
|
505
523
|
|
data/lib/veri/configuration.rb
CHANGED
|
@@ -66,7 +66,7 @@ module Veri
|
|
|
66
66
|
Veri::Inputs::Model.new(
|
|
67
67
|
user_model_name,
|
|
68
68
|
error: Veri::ConfigurationError,
|
|
69
|
-
message: "Invalid user model name `#{user_model_name}`,
|
|
69
|
+
message: "Invalid user model name `#{user_model_name}`, model does not exist"
|
|
70
70
|
).process
|
|
71
71
|
end
|
|
72
72
|
|
data/lib/veri/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: veri
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- enjaku4
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-03-28 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: argon2
|
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
147
147
|
- !ruby/object:Gem::Version
|
|
148
148
|
version: '0'
|
|
149
149
|
requirements: []
|
|
150
|
-
rubygems_version:
|
|
150
|
+
rubygems_version: 4.0.3
|
|
151
151
|
specification_version: 4
|
|
152
152
|
summary: Minimal cookie-based authentication library for Ruby on Rails
|
|
153
153
|
test_files: []
|