stytch 3.10.0 → 3.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c3467a9df6c34d419a806c5822edd9878a6b17a60bc3abb7c85ab336695f25c
4
- data.tar.gz: 8a7a8c5ea9f8247156d45b98b67708bf02bee10959269accb2cd5dc231787438
3
+ metadata.gz: b50d6df846a8cd5ac93f94ec1744ff5f7b17d96bdba656d9fb0bad658aa2cab2
4
+ data.tar.gz: 5dc77db5fdbdc0a145bb6767cefbe50ad0f6afdab18cea3c2bd494ad18e00e6c
5
5
  SHA512:
6
- metadata.gz: 63972fb9e432920750a1aedad82a1cd278305168dc38fc49cf987b288a8eeb857097a819d3c19c1f5ea65f9caf9978b06461fe9356e40b8390207e1471479446
7
- data.tar.gz: b09cdec0f8430abac465cb0eae09183d71fda517019d4f583befa8f386207b4a941b7cdb4cd0bd9632facd053fca7c2734ef81e21351f159898d2375e11c9b6e
6
+ metadata.gz: 1b8bdd22e64273984515964773b1c0dd7cf01b1b47b0114ee78d56583ae680caa8c40012ae85b72301cce4a6ee85645d28a4232e70a93c2aef5098c27aa5cf60
7
+ data.tar.gz: 3bf134bb649f5c3e88ebd5dd73fef835a0b3c4dde93da28bbec74fa4ca91f5f074cc6c32aae8abc11afb97e22d3eb9cd7016b57d0baa1d48f2340b7fc52e118f
@@ -6,7 +6,7 @@ module Stytch
6
6
  class Passwords
7
7
  include Stytch::RequestHelper
8
8
 
9
- attr_reader :email, :existing_password
9
+ attr_reader :email, :existing_password, :session
10
10
 
11
11
  PATH = '/v1/passwords'
12
12
 
@@ -15,6 +15,7 @@ module Stytch
15
15
 
16
16
  @email = Stytch::Passwords::Email.new(@connection)
17
17
  @existing_password = Stytch::Passwords::ExistingPassword.new(@connection)
18
+ @session = Stytch::Passwords::Session.new(@connection)
18
19
  end
19
20
 
20
21
  def create(
@@ -73,7 +74,9 @@ module Stytch
73
74
  hash:,
74
75
  hash_type:,
75
76
  md_5_config: {},
76
- argon_2_config: {}
77
+ argon_2_config: {},
78
+ sha_1_config: {},
79
+ scrypt_config: {}
77
80
  )
78
81
  request = {
79
82
  email: email,
@@ -83,6 +86,8 @@ module Stytch
83
86
 
84
87
  request[:md_5_config] = md_5_config unless md_5_config != {}
85
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 != {}
86
91
 
87
92
  post_request("#{PATH}/migrate", request)
88
93
  end
@@ -180,5 +185,28 @@ module Stytch
180
185
  post_request("#{PATH}/reset", request)
181
186
  end
182
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
183
211
  end
184
212
  end
data/lib/stytch/users.rb CHANGED
@@ -127,6 +127,12 @@ 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
+
130
136
  private
131
137
 
132
138
  def format_emails(emails)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '3.10.0'
4
+ VERSION = '3.11.0'
5
5
  end
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.10.0
4
+ version: 3.11.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-01 00:00:00.000000000 Z
11
+ date: 2022-08-12 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.1.4
152
- signing_key:
151
+ rubygems_version: 3.0.3.1
152
+ signing_key:
153
153
  specification_version: 4
154
154
  summary: Stytch Ruby Gem
155
155
  test_files: []