stytch 3.9.0 → 3.12.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/lib/stytch/passwords.rb +64 -2
- data/lib/stytch/users.rb +12 -0
- data/lib/stytch/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcec2519afaa87ccb48ce1f442910f09618744fb106e4e25f2064a4c46ac5183
|
|
4
|
+
data.tar.gz: f0f88be1b93f0c24abe360dd77d75bd51372c1b2a5aa6df44a27a429624b8f8f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 488423abdd75a523de43be11740a329ad27209b666667e0d6343c3bfbcd02dba495067c57aaf82200d715d0aeb34f1648769e14e26d9b6047dcf972f2834cb52
|
|
7
|
+
data.tar.gz: 2894e4571c63276cd74286b9b9c4ee8c7407c101c31da4bd6505ab2e370c8ca07b6eb6254b34a36cc4e69cd39073685045e31d805628cca64fe56db7f4a549e5
|
data/lib/stytch/passwords.rb
CHANGED
|
@@ -6,7 +6,7 @@ module Stytch
|
|
|
6
6
|
class Passwords
|
|
7
7
|
include Stytch::RequestHelper
|
|
8
8
|
|
|
9
|
-
attr_reader :email
|
|
9
|
+
attr_reader :email, :existing_password, :session
|
|
10
10
|
|
|
11
11
|
PATH = '/v1/passwords'
|
|
12
12
|
|
|
@@ -14,6 +14,8 @@ module Stytch
|
|
|
14
14
|
@connection = connection
|
|
15
15
|
|
|
16
16
|
@email = Stytch::Passwords::Email.new(@connection)
|
|
17
|
+
@existing_password = Stytch::Passwords::ExistingPassword.new(@connection)
|
|
18
|
+
@session = Stytch::Passwords::Session.new(@connection)
|
|
17
19
|
end
|
|
18
20
|
|
|
19
21
|
def create(
|
|
@@ -72,7 +74,9 @@ module Stytch
|
|
|
72
74
|
hash:,
|
|
73
75
|
hash_type:,
|
|
74
76
|
md_5_config: {},
|
|
75
|
-
argon_2_config: {}
|
|
77
|
+
argon_2_config: {},
|
|
78
|
+
sha_1_config: {},
|
|
79
|
+
scrypt_config: {}
|
|
76
80
|
)
|
|
77
81
|
request = {
|
|
78
82
|
email: email,
|
|
@@ -82,6 +86,8 @@ module Stytch
|
|
|
82
86
|
|
|
83
87
|
request[:md_5_config] = md_5_config unless md_5_config != {}
|
|
84
88
|
request[:argon_2_config] = argon_2_config unless argon_2_config != {}
|
|
89
|
+
request[:sha_1_config] = sha_1_config unless sha_1_config != {}
|
|
90
|
+
request[:scrypt_config] = scrypt_config unless scrypt_config != {}
|
|
85
91
|
|
|
86
92
|
post_request("#{PATH}/migrate", request)
|
|
87
93
|
end
|
|
@@ -146,5 +152,61 @@ module Stytch
|
|
|
146
152
|
post_request("#{PATH}/reset", request)
|
|
147
153
|
end
|
|
148
154
|
end
|
|
155
|
+
|
|
156
|
+
class ExistingPassword
|
|
157
|
+
include Stytch::RequestHelper
|
|
158
|
+
|
|
159
|
+
PATH = "#{Stytch::Passwords::PATH}/existing_password"
|
|
160
|
+
|
|
161
|
+
def initialize(connection)
|
|
162
|
+
@connection = connection
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def reset(
|
|
166
|
+
email:,
|
|
167
|
+
existing_password:,
|
|
168
|
+
new_password:,
|
|
169
|
+
session_token: nil,
|
|
170
|
+
session_jwt: nil,
|
|
171
|
+
session_duration_minutes: nil,
|
|
172
|
+
session_custom_claims: nil
|
|
173
|
+
)
|
|
174
|
+
request = {
|
|
175
|
+
email: email,
|
|
176
|
+
existing_password: existing_password,
|
|
177
|
+
new_password: new_password
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
request[:session_token] = session_token unless session_token.nil?
|
|
181
|
+
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
182
|
+
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
|
183
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
|
184
|
+
|
|
185
|
+
post_request("#{PATH}/reset", request)
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
class Session
|
|
190
|
+
include Stytch::RequestHelper
|
|
191
|
+
|
|
192
|
+
PATH = "#{Stytch::Passwords::PATH}/session"
|
|
193
|
+
|
|
194
|
+
def initialize(connection)
|
|
195
|
+
@connection = connection
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
def reset(
|
|
199
|
+
password:,
|
|
200
|
+
session_token: nil,
|
|
201
|
+
session_jwt: nil
|
|
202
|
+
)
|
|
203
|
+
request = { password: password }
|
|
204
|
+
|
|
205
|
+
request[:session_token] = session_token unless session_token.nil?
|
|
206
|
+
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
207
|
+
|
|
208
|
+
post_request("#{PATH}/reset", request)
|
|
209
|
+
end
|
|
210
|
+
end
|
|
149
211
|
end
|
|
150
212
|
end
|
data/lib/stytch/users.rb
CHANGED
|
@@ -127,6 +127,18 @@ module Stytch
|
|
|
127
127
|
delete_request("#{PATH}/crypto_wallets/#{crypto_wallet_id}")
|
|
128
128
|
end
|
|
129
129
|
|
|
130
|
+
def delete_password(
|
|
131
|
+
password_id:
|
|
132
|
+
)
|
|
133
|
+
delete_request("#{PATH}/passwords/#{password_id}")
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def delete_biometric_registration(
|
|
137
|
+
biometric_registration_id:
|
|
138
|
+
)
|
|
139
|
+
delete_request("#{PATH}/biometric_registrations/#{biometric_registration_id}")
|
|
140
|
+
end
|
|
141
|
+
|
|
130
142
|
private
|
|
131
143
|
|
|
132
144
|
def format_emails(emails)
|
data/lib/stytch/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stytch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- stytch
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-08-
|
|
11
|
+
date: 2022-08-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -92,7 +92,7 @@ dependencies:
|
|
|
92
92
|
- - ">="
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
94
|
version: 3.5.3
|
|
95
|
-
description:
|
|
95
|
+
description:
|
|
96
96
|
email:
|
|
97
97
|
- support@stytch.com
|
|
98
98
|
executables: []
|
|
@@ -133,7 +133,7 @@ licenses:
|
|
|
133
133
|
metadata:
|
|
134
134
|
homepage_uri: https://stytch.com
|
|
135
135
|
source_code_uri: https://github.com/stytchauth/stytch-ruby
|
|
136
|
-
post_install_message:
|
|
136
|
+
post_install_message:
|
|
137
137
|
rdoc_options: []
|
|
138
138
|
require_paths:
|
|
139
139
|
- lib
|
|
@@ -148,8 +148,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
148
148
|
- !ruby/object:Gem::Version
|
|
149
149
|
version: '0'
|
|
150
150
|
requirements: []
|
|
151
|
-
rubygems_version: 3.
|
|
152
|
-
signing_key:
|
|
151
|
+
rubygems_version: 3.0.3
|
|
152
|
+
signing_key:
|
|
153
153
|
specification_version: 4
|
|
154
154
|
summary: Stytch Ruby Gem
|
|
155
155
|
test_files: []
|