devise-argon2 1.1.0 → 2.0.1
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 +66 -0
- data/.gitignore +3 -0
- data/CHANGELOG.md +32 -0
- data/Gemfile +9 -4
- data/README.md +120 -32
- data/devise-argon2.gemspec +17 -14
- data/lib/devise-argon2/model.rb +101 -0
- data/lib/devise-argon2/version.rb +5 -0
- data/lib/devise-argon2.rb +8 -3
- data/spec/devise-argon2_spec.rb +273 -27
- data/spec/orm/active_record.rb +1 -0
- data/spec/orm/mongoid.rb +5 -0
- data/spec/rails_app/Rakefile +6 -0
- data/spec/rails_app/app/active_record/old_user.rb +3 -0
- data/spec/rails_app/app/active_record/user.rb +3 -0
- data/spec/rails_app/app/controllers/application_controller.rb +3 -0
- data/spec/rails_app/app/mongoid/old_user.rb +12 -0
- data/spec/rails_app/app/mongoid/user.rb +10 -0
- data/spec/rails_app/bin/bundle +109 -0
- data/spec/rails_app/bin/rails +4 -0
- data/spec/rails_app/bin/rake +4 -0
- data/spec/rails_app/bin/setup +33 -0
- data/spec/rails_app/config/application.rb +24 -0
- data/spec/rails_app/config/boot.rb +5 -0
- data/spec/rails_app/config/database.yml +14 -0
- data/spec/rails_app/config/environment.rb +7 -0
- data/spec/rails_app/config/initializers/devise.rb +6 -0
- data/spec/rails_app/config/mongoid.yml +10 -0
- data/spec/rails_app/config.ru +6 -0
- data/spec/rails_app/db/migrate/20230617201921_devise_create_users.rb +15 -0
- data/spec/rails_app/db/migrate/20231004084147_devise_create_old_users.rb +17 -0
- data/spec/rails_app/db/schema.rb +31 -0
- data/spec/spec_helper.rb +7 -3
- metadata +64 -31
- data/.travis.yml +0 -13
- data/lib/devise/encryptable/encryptors/argon2/version.rb +0 -7
- data/lib/devise/encryptable/encryptors/argon2.rb +0 -17
@@ -0,0 +1,31 @@
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead
|
2
|
+
# of editing this file, please use the migrations feature of Active Record to
|
3
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# This file is the source Rails uses to define your schema when running `bin/rails
|
6
|
+
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
7
|
+
# be faster and is potentially less error prone than running all of your
|
8
|
+
# migrations from scratch. Old migrations may fail to apply correctly if those
|
9
|
+
# migrations use external dependencies or application code.
|
10
|
+
#
|
11
|
+
# It's strongly recommended that you check this file into your version control system.
|
12
|
+
|
13
|
+
ActiveRecord::Schema.define(version: 2023_10_04_084147) do
|
14
|
+
create_table "old_users", force: :cascade do |t|
|
15
|
+
t.string "email", default: "", null: false
|
16
|
+
t.string "encrypted_password", default: "", null: false
|
17
|
+
t.string "password_salt"
|
18
|
+
t.datetime "created_at", null: false
|
19
|
+
t.datetime "updated_at", null: false
|
20
|
+
t.index ["email"], name: "index_old_users_on_email", unique: true
|
21
|
+
end
|
22
|
+
|
23
|
+
create_table "users", force: :cascade do |t|
|
24
|
+
t.string "email", default: "", null: false
|
25
|
+
t.string "encrypted_password", default: "", null: false
|
26
|
+
t.datetime "created_at", null: false
|
27
|
+
t.datetime "updated_at", null: false
|
28
|
+
t.index ["email"], name: "index_users_on_email", unique: true
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'simplecov'
|
3
3
|
SimpleCov.start
|
4
|
-
require 'pry'
|
5
4
|
require 'bundler/setup'
|
6
|
-
|
5
|
+
|
6
|
+
require 'rails_app/config/environment'
|
7
|
+
ORM = (ENV['ORM'] || 'active_record')
|
8
|
+
require "orm/#{ORM}"
|
9
|
+
|
10
|
+
|
7
11
|
|
8
12
|
RSpec.configure do |config|
|
9
|
-
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,81 +1,93 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-argon2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tamas Erdos
|
8
|
+
- Moritz Höppner
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2023-10-19 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: devise
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 2.1.0
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 2.1.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: devise-encryptable
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
18
|
+
- - "~>"
|
32
19
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
20
|
+
version: '4.0'
|
34
21
|
type: :runtime
|
35
22
|
prerelease: false
|
36
23
|
version_requirements: !ruby/object:Gem::Requirement
|
37
24
|
requirements:
|
38
|
-
- - "
|
25
|
+
- - "~>"
|
39
26
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
27
|
+
version: '4.0'
|
41
28
|
- !ruby/object:Gem::Dependency
|
42
29
|
name: argon2
|
43
30
|
requirement: !ruby/object:Gem::Requirement
|
44
31
|
requirements:
|
45
32
|
- - "~>"
|
46
33
|
- !ruby/object:Gem::Version
|
47
|
-
version: '2.
|
34
|
+
version: '2.1'
|
48
35
|
type: :runtime
|
49
36
|
prerelease: false
|
50
37
|
version_requirements: !ruby/object:Gem::Requirement
|
51
38
|
requirements:
|
52
39
|
- - "~>"
|
53
40
|
- !ruby/object:Gem::Version
|
54
|
-
version: '2.
|
55
|
-
description:
|
41
|
+
version: '2.1'
|
42
|
+
description: Enables Devise to hash passwords with Argon2id
|
56
43
|
email:
|
57
44
|
- tamas at tamaserdos com
|
58
45
|
executables: []
|
59
46
|
extensions: []
|
60
47
|
extra_rdoc_files: []
|
61
48
|
files:
|
49
|
+
- ".github/workflows/test.yml"
|
62
50
|
- ".gitignore"
|
63
51
|
- ".rspec"
|
64
|
-
-
|
52
|
+
- CHANGELOG.md
|
65
53
|
- Gemfile
|
66
54
|
- LICENSE.txt
|
67
55
|
- README.md
|
68
56
|
- Rakefile
|
69
57
|
- devise-argon2.gemspec
|
70
58
|
- lib/devise-argon2.rb
|
71
|
-
- lib/devise/
|
72
|
-
- lib/devise
|
59
|
+
- lib/devise-argon2/model.rb
|
60
|
+
- lib/devise-argon2/version.rb
|
73
61
|
- spec/devise-argon2_spec.rb
|
62
|
+
- spec/orm/active_record.rb
|
63
|
+
- spec/orm/mongoid.rb
|
64
|
+
- spec/rails_app/Rakefile
|
65
|
+
- spec/rails_app/app/active_record/old_user.rb
|
66
|
+
- spec/rails_app/app/active_record/user.rb
|
67
|
+
- spec/rails_app/app/controllers/application_controller.rb
|
68
|
+
- spec/rails_app/app/mongoid/old_user.rb
|
69
|
+
- spec/rails_app/app/mongoid/user.rb
|
70
|
+
- spec/rails_app/bin/bundle
|
71
|
+
- spec/rails_app/bin/rails
|
72
|
+
- spec/rails_app/bin/rake
|
73
|
+
- spec/rails_app/bin/setup
|
74
|
+
- spec/rails_app/config.ru
|
75
|
+
- spec/rails_app/config/application.rb
|
76
|
+
- spec/rails_app/config/boot.rb
|
77
|
+
- spec/rails_app/config/database.yml
|
78
|
+
- spec/rails_app/config/environment.rb
|
79
|
+
- spec/rails_app/config/initializers/devise.rb
|
80
|
+
- spec/rails_app/config/mongoid.yml
|
81
|
+
- spec/rails_app/db/migrate/20230617201921_devise_create_users.rb
|
82
|
+
- spec/rails_app/db/migrate/20231004084147_devise_create_old_users.rb
|
83
|
+
- spec/rails_app/db/schema.rb
|
74
84
|
- spec/spec_helper.rb
|
75
85
|
homepage: https://github.com/erdostom/devise-argon2
|
76
|
-
licenses:
|
86
|
+
licenses:
|
87
|
+
- MIT
|
77
88
|
metadata: {}
|
78
|
-
post_install_message:
|
89
|
+
post_install_message: Version 2 of devise-argon2 introduces breaking changes, please
|
90
|
+
see README.md for details.
|
79
91
|
rdoc_options: []
|
80
92
|
require_paths:
|
81
93
|
- lib
|
@@ -90,11 +102,32 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
102
|
- !ruby/object:Gem::Version
|
91
103
|
version: '0'
|
92
104
|
requirements: []
|
93
|
-
|
94
|
-
rubygems_version: 2.7.8
|
105
|
+
rubygems_version: 3.3.3
|
95
106
|
signing_key:
|
96
107
|
specification_version: 4
|
97
|
-
summary:
|
108
|
+
summary: Enables Devise to hash passwords with Argon2id
|
98
109
|
test_files:
|
99
110
|
- spec/devise-argon2_spec.rb
|
111
|
+
- spec/orm/active_record.rb
|
112
|
+
- spec/orm/mongoid.rb
|
113
|
+
- spec/rails_app/Rakefile
|
114
|
+
- spec/rails_app/app/active_record/old_user.rb
|
115
|
+
- spec/rails_app/app/active_record/user.rb
|
116
|
+
- spec/rails_app/app/controllers/application_controller.rb
|
117
|
+
- spec/rails_app/app/mongoid/old_user.rb
|
118
|
+
- spec/rails_app/app/mongoid/user.rb
|
119
|
+
- spec/rails_app/bin/bundle
|
120
|
+
- spec/rails_app/bin/rails
|
121
|
+
- spec/rails_app/bin/rake
|
122
|
+
- spec/rails_app/bin/setup
|
123
|
+
- spec/rails_app/config.ru
|
124
|
+
- spec/rails_app/config/application.rb
|
125
|
+
- spec/rails_app/config/boot.rb
|
126
|
+
- spec/rails_app/config/database.yml
|
127
|
+
- spec/rails_app/config/environment.rb
|
128
|
+
- spec/rails_app/config/initializers/devise.rb
|
129
|
+
- spec/rails_app/config/mongoid.yml
|
130
|
+
- spec/rails_app/db/migrate/20230617201921_devise_create_users.rb
|
131
|
+
- spec/rails_app/db/migrate/20231004084147_devise_create_old_users.rb
|
132
|
+
- spec/rails_app/db/schema.rb
|
100
133
|
- spec/spec_helper.rb
|
data/.travis.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'argon2'
|
2
|
-
|
3
|
-
module Devise
|
4
|
-
module Encryptable
|
5
|
-
module Encryptors
|
6
|
-
class Argon2 < Base
|
7
|
-
def self.digest(password, stretches, salt, pepper)
|
8
|
-
::Argon2::Password.create("#{password}#{salt}#{pepper}")
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.compare(encrypted_password, password, stretches, salt, pepper)
|
12
|
-
::Argon2::Password.verify_password("#{password}#{salt}#{pepper}", encrypted_password)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|