workos 0.6.0 → 0.7.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/Gemfile.lock +1 -1
- data/lib/workos.rb +1 -0
- data/lib/workos/audit_trail.rb +2 -2
- data/lib/workos/client.rb +13 -7
- data/lib/workos/passwordless.rb +81 -0
- data/lib/workos/types.rb +1 -0
- data/lib/workos/types/passwordless_session_struct.rb +15 -0
- data/lib/workos/version.rb +1 -1
- data/spec/lib/workos/passwordless_spec.rb +82 -0
- data/spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml +73 -0
- data/spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml +73 -0
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbb2aa0d20fb9d4fa99930c63d67240f2bb911613dd48848aa2c89d5dc94fcf7
|
4
|
+
data.tar.gz: 838ca6771237c0df8acd0e7b1ef59c021f87f8b4c7e94b32a5f6fb83c3158ac9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bf3d16a8e76427557d5b08dc2897e167730a7b8b81fc96c42b6c04b5db74f64a5c06b24f381784f6b9c845fcff945fc273f3d0ceaf872d97c80c0b1beb6639f
|
7
|
+
data.tar.gz: 0f33de9781d1df7fd2f02bac813cbb3d192fe17f5690a28804a848400d422575e2d7e91c955259d99ff7fbc5bd60d457a595fe7279128058d3ba0100c1858378
|
data/Gemfile.lock
CHANGED
data/lib/workos.rb
CHANGED
@@ -32,6 +32,7 @@ module WorkOS
|
|
32
32
|
autoload :Connection, 'workos/connection'
|
33
33
|
autoload :DirectorySync, 'workos/directory_sync'
|
34
34
|
autoload :Organization, 'workos/organization'
|
35
|
+
autoload :Passwordless, 'workos/passwordless'
|
35
36
|
autoload :Portal, 'workos/portal'
|
36
37
|
autoload :Profile, 'workos/profile'
|
37
38
|
autoload :SSO, 'workos/sso'
|
data/lib/workos/audit_trail.rb
CHANGED
@@ -83,8 +83,8 @@ module WorkOS
|
|
83
83
|
# event occurred at or after
|
84
84
|
# @option options [String] occurred_at_lt ISO-8601 datetime of when an
|
85
85
|
# event occurred before
|
86
|
-
# @option options [String] ISO-8601 datetime of when an
|
87
|
-
# or before
|
86
|
+
# @option options [String] occurred_at_lte ISO-8601 datetime of when an
|
87
|
+
# event occured at or before
|
88
88
|
# @option options [String] search Keyword search
|
89
89
|
#
|
90
90
|
# @return [Array<Hash>]
|
data/lib/workos/client.rb
CHANGED
@@ -81,8 +81,7 @@ module WorkOS
|
|
81
81
|
].join('; ')
|
82
82
|
end
|
83
83
|
|
84
|
-
|
85
|
-
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
84
|
+
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity
|
86
85
|
sig { params(response: ::T.untyped).void }
|
87
86
|
def handle_error_response(response:)
|
88
87
|
http_status = response.code.to_i
|
@@ -108,11 +107,10 @@ module WorkOS
|
|
108
107
|
request_id: response['x-request-id'],
|
109
108
|
)
|
110
109
|
when 422
|
111
|
-
|
112
|
-
|
113
|
-
|
110
|
+
message = json['message']
|
111
|
+
errors = extract_error(json['errors']) if json['errors']
|
112
|
+
message += " (#{errors})" if errors
|
114
113
|
|
115
|
-
message = "#{json['message']} (#{errors})"
|
116
114
|
raise InvalidRequestError.new(
|
117
115
|
message: message,
|
118
116
|
http_status: http_status,
|
@@ -120,6 +118,14 @@ module WorkOS
|
|
120
118
|
)
|
121
119
|
end
|
122
120
|
end
|
123
|
-
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
121
|
+
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity
|
122
|
+
|
123
|
+
private
|
124
|
+
|
125
|
+
def extract_error(errors)
|
126
|
+
errors.map do |error|
|
127
|
+
"#{error['field']}: #{error['code']}"
|
128
|
+
end.join('; ')
|
129
|
+
end
|
124
130
|
end
|
125
131
|
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: true
|
3
|
+
|
4
|
+
require 'net/http'
|
5
|
+
|
6
|
+
module WorkOS
|
7
|
+
# The Passwordless module provides convenience methods for working with
|
8
|
+
# passwordless sessions including the WorkOS Magic Link. You'll need a valid
|
9
|
+
# API key.
|
10
|
+
#
|
11
|
+
# @see https://workos.com/docs/sso/configuring-magic-link
|
12
|
+
module Passwordless
|
13
|
+
class << self
|
14
|
+
extend T::Sig
|
15
|
+
include Base
|
16
|
+
include Client
|
17
|
+
|
18
|
+
# Create a Passwordless Session.
|
19
|
+
#
|
20
|
+
# @param [Hash] options A hash with options for the session
|
21
|
+
# @option options [String] email The email of the user to authenticate.
|
22
|
+
# @option options [String] state Optional parameter that the redirect URI
|
23
|
+
# received from WorkOS will contain. The state parameter can be used to
|
24
|
+
# encode arbitrary information to help restore application state between
|
25
|
+
# redirects.
|
26
|
+
# @option options [String] type The type of Passwordless Session to
|
27
|
+
# create. Currently, the only supported value is 'MagicLink'.
|
28
|
+
#
|
29
|
+
# @return Hash
|
30
|
+
sig do
|
31
|
+
params(
|
32
|
+
options: Hash,
|
33
|
+
).returns(WorkOS::Types::PasswordlessSessionStruct)
|
34
|
+
end
|
35
|
+
|
36
|
+
# rubocop:disable Metrics/MethodLength
|
37
|
+
def create_session(options)
|
38
|
+
response = execute_request(
|
39
|
+
request: post_request(
|
40
|
+
path: '/passwordless/sessions',
|
41
|
+
auth: true,
|
42
|
+
body: options,
|
43
|
+
),
|
44
|
+
)
|
45
|
+
|
46
|
+
hash = JSON.parse(response.body)
|
47
|
+
|
48
|
+
WorkOS::Types::PasswordlessSessionStruct.new(
|
49
|
+
id: hash['id'],
|
50
|
+
email: hash['email'],
|
51
|
+
expires_at: Date.parse(hash['expires_at']),
|
52
|
+
link: hash['link'],
|
53
|
+
)
|
54
|
+
end
|
55
|
+
# rubocop:enable Metrics/MethodLength
|
56
|
+
|
57
|
+
# Send a Passwordless Session via email.
|
58
|
+
#
|
59
|
+
# @param [String] session_id The unique identifier of the Passwordless
|
60
|
+
# Session to send an email for.
|
61
|
+
#
|
62
|
+
# @return Hash
|
63
|
+
sig do
|
64
|
+
params(
|
65
|
+
session_id: String,
|
66
|
+
).returns(T::Hash[String, T::Boolean])
|
67
|
+
end
|
68
|
+
|
69
|
+
def send_session(session_id)
|
70
|
+
response = execute_request(
|
71
|
+
request: post_request(
|
72
|
+
path: "/passwordless/sessions/#{session_id}/send",
|
73
|
+
auth: true,
|
74
|
+
),
|
75
|
+
)
|
76
|
+
|
77
|
+
JSON.parse(response.body)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
data/lib/workos/types.rb
CHANGED
@@ -9,6 +9,7 @@ module WorkOS
|
|
9
9
|
require_relative 'types/intent_enum'
|
10
10
|
require_relative 'types/list_struct'
|
11
11
|
require_relative 'types/organization_struct'
|
12
|
+
require_relative 'types/passwordless_session_struct'
|
12
13
|
require_relative 'types/profile_struct'
|
13
14
|
require_relative 'types/provider_enum'
|
14
15
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: strict
|
3
|
+
|
4
|
+
module WorkOS
|
5
|
+
module Types
|
6
|
+
# This PasswordlessSessionStruct acts as a typed interface
|
7
|
+
# for the Passwordless class
|
8
|
+
class PasswordlessSessionStruct < T::Struct
|
9
|
+
const :id, String
|
10
|
+
const :email, String
|
11
|
+
const :expires_at, Date
|
12
|
+
const :link, String
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/workos/version.rb
CHANGED
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: false
|
3
|
+
|
4
|
+
describe WorkOS::Passwordless do
|
5
|
+
before(:all) do
|
6
|
+
WorkOS.key = 'key'
|
7
|
+
end
|
8
|
+
|
9
|
+
after(:all) do
|
10
|
+
WorkOS.key = nil
|
11
|
+
end
|
12
|
+
|
13
|
+
describe '.create_session' do
|
14
|
+
context 'with valid options payload' do
|
15
|
+
let(:valid_options) do
|
16
|
+
{
|
17
|
+
email: 'demo@workos-okta.com',
|
18
|
+
type: 'MagicLink',
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'creates a session' do
|
23
|
+
VCR.use_cassette('passwordless/create_session') do
|
24
|
+
response = described_class.create_session(valid_options)
|
25
|
+
|
26
|
+
expect(response.email).to eq 'demo@workos-okta.com'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'with invalid event payload' do
|
32
|
+
let(:invalid_options) do
|
33
|
+
{}
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'raises an error' do
|
37
|
+
VCR.use_cassette('passwordless/create_session_invalid') do
|
38
|
+
expect do
|
39
|
+
described_class.create_session(invalid_options)
|
40
|
+
end.to raise_error(
|
41
|
+
WorkOS::InvalidRequestError,
|
42
|
+
/Status 422, Validation failed \(email: email must be a string; type: type must be a valid enum value\)/,
|
43
|
+
)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
describe '.send_session' do
|
50
|
+
context 'with valid session id' do
|
51
|
+
let(:valid_options) do
|
52
|
+
{
|
53
|
+
email: 'demo@workos-okta.com',
|
54
|
+
type: 'MagicLink',
|
55
|
+
}
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'send a session' do
|
59
|
+
VCR.use_cassette('passwordless/send_session') do
|
60
|
+
response = described_class.send_session(
|
61
|
+
'passwordless_session_01EJC0F4KH42T11Y2DHPEB09BM',
|
62
|
+
)
|
63
|
+
|
64
|
+
expect(response['success']).to eq true
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
context 'with invalid session id' do
|
70
|
+
it 'raises an error' do
|
71
|
+
VCR.use_cassette('passwordless/send_session_invalid') do
|
72
|
+
expect do
|
73
|
+
described_class.send_session('session_123')
|
74
|
+
end.to raise_error(
|
75
|
+
WorkOS::InvalidRequestError,
|
76
|
+
/Status 422, The passwordless session 'session_123' has expired or is invalid./,
|
77
|
+
)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/passwordless/sessions
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"email":"demo@workos-okta.com","type":"MagicLink"}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
User-Agent:
|
17
|
+
- WorkOS; ruby/2.7.1; x86_64-darwin19; v0.7.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: Created
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- Cowboy
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Vary:
|
30
|
+
- Origin, Accept-Encoding
|
31
|
+
Access-Control-Allow-Credentials:
|
32
|
+
- 'true'
|
33
|
+
Content-Security-Policy:
|
34
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
35
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
36
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
37
|
+
X-Dns-Prefetch-Control:
|
38
|
+
- 'off'
|
39
|
+
Expect-Ct:
|
40
|
+
- max-age=0
|
41
|
+
X-Frame-Options:
|
42
|
+
- SAMEORIGIN
|
43
|
+
Strict-Transport-Security:
|
44
|
+
- max-age=15552000; includeSubDomains
|
45
|
+
X-Download-Options:
|
46
|
+
- noopen
|
47
|
+
X-Content-Type-Options:
|
48
|
+
- nosniff
|
49
|
+
X-Permitted-Cross-Domain-Policies:
|
50
|
+
- none
|
51
|
+
Referrer-Policy:
|
52
|
+
- no-referrer
|
53
|
+
X-Xss-Protection:
|
54
|
+
- '0'
|
55
|
+
X-Request-Id:
|
56
|
+
- 611c2a85-84e1-4bad-a2ec-43cf8371f134
|
57
|
+
Content-Type:
|
58
|
+
- application/json; charset=utf-8
|
59
|
+
Content-Length:
|
60
|
+
- '238'
|
61
|
+
Etag:
|
62
|
+
- W/"ee-6KkIusxSXraxKqTLP+31C0PeHDU"
|
63
|
+
Date:
|
64
|
+
- Wed, 16 Sep 2020 15:39:08 GMT
|
65
|
+
Via:
|
66
|
+
- 1.1 vegur
|
67
|
+
body:
|
68
|
+
encoding: UTF-8
|
69
|
+
string: '{"object":"passwordless_session","id":"passwordless_session_01EJBS3JSXFE2DP6JC6ZVBZ095","email":"demo@workos-okta.com","expires_at":"2020-09-16T15:44:08.475Z","link":"https://api.workos.com/passwordless/ZBxkn2ZTUYqa82ky6QEYecemI/confirm"}'
|
70
|
+
http_version:
|
71
|
+
recorded_at: Wed, 16 Sep 2020 15:39:08 GMT
|
72
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,73 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/passwordless/sessions
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: "{}"
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
User-Agent:
|
17
|
+
- WorkOS; ruby/2.7.1; x86_64-darwin19; v0.7.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer sk_4q5ka3d9bx0XJiZhkKmUIOG87
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 422
|
23
|
+
message: Unprocessable Entity
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- Cowboy
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Vary:
|
30
|
+
- Origin, Accept-Encoding
|
31
|
+
Access-Control-Allow-Credentials:
|
32
|
+
- 'true'
|
33
|
+
Content-Security-Policy:
|
34
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
35
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
36
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
37
|
+
X-Dns-Prefetch-Control:
|
38
|
+
- 'off'
|
39
|
+
Expect-Ct:
|
40
|
+
- max-age=0
|
41
|
+
X-Frame-Options:
|
42
|
+
- SAMEORIGIN
|
43
|
+
Strict-Transport-Security:
|
44
|
+
- max-age=15552000; includeSubDomains
|
45
|
+
X-Download-Options:
|
46
|
+
- noopen
|
47
|
+
X-Content-Type-Options:
|
48
|
+
- nosniff
|
49
|
+
X-Permitted-Cross-Domain-Policies:
|
50
|
+
- none
|
51
|
+
Referrer-Policy:
|
52
|
+
- no-referrer
|
53
|
+
X-Xss-Protection:
|
54
|
+
- '0'
|
55
|
+
X-Request-Id:
|
56
|
+
- e3ca7215-2b2d-45cf-a04f-90279225f27e
|
57
|
+
Content-Type:
|
58
|
+
- application/json; charset=utf-8
|
59
|
+
Content-Length:
|
60
|
+
- '150'
|
61
|
+
Etag:
|
62
|
+
- W/"96-O5ltHaJ3rEQ8+dqFwhN+Lhmgdb0"
|
63
|
+
Date:
|
64
|
+
- Wed, 16 Sep 2020 17:34:07 GMT
|
65
|
+
Via:
|
66
|
+
- 1.1 vegur
|
67
|
+
body:
|
68
|
+
encoding: UTF-8
|
69
|
+
string: '{"message":"Validation failed","errors":[{"field":"email","code":"email
|
70
|
+
must be a string"},{"field":"type","code":"type must be a valid enum value"}]}'
|
71
|
+
http_version:
|
72
|
+
recorded_at: Wed, 16 Sep 2020 17:34:07 GMT
|
73
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,72 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/passwordless/sessions/passwordless_session_01EJC0F4KH42T11Y2DHPEB09BM/send
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
User-Agent:
|
17
|
+
- WorkOS; ruby/2.7.1; x86_64-darwin19; v0.7.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer sk_4q5ka3d9bx0XJiZhkKmUIOG87
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: Created
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- Cowboy
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Vary:
|
30
|
+
- Origin, Accept-Encoding
|
31
|
+
Access-Control-Allow-Credentials:
|
32
|
+
- 'true'
|
33
|
+
Content-Security-Policy:
|
34
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
35
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
36
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
37
|
+
X-Dns-Prefetch-Control:
|
38
|
+
- 'off'
|
39
|
+
Expect-Ct:
|
40
|
+
- max-age=0
|
41
|
+
X-Frame-Options:
|
42
|
+
- SAMEORIGIN
|
43
|
+
Strict-Transport-Security:
|
44
|
+
- max-age=15552000; includeSubDomains
|
45
|
+
X-Download-Options:
|
46
|
+
- noopen
|
47
|
+
X-Content-Type-Options:
|
48
|
+
- nosniff
|
49
|
+
X-Permitted-Cross-Domain-Policies:
|
50
|
+
- none
|
51
|
+
Referrer-Policy:
|
52
|
+
- no-referrer
|
53
|
+
X-Xss-Protection:
|
54
|
+
- '0'
|
55
|
+
X-Request-Id:
|
56
|
+
- d7d72520-9223-4145-b34e-df5e80a776d6
|
57
|
+
Content-Type:
|
58
|
+
- application/json; charset=utf-8
|
59
|
+
Content-Length:
|
60
|
+
- '16'
|
61
|
+
Etag:
|
62
|
+
- W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA"
|
63
|
+
Date:
|
64
|
+
- Wed, 16 Sep 2020 17:47:47 GMT
|
65
|
+
Via:
|
66
|
+
- 1.1 vegur
|
67
|
+
body:
|
68
|
+
encoding: UTF-8
|
69
|
+
string: '{"success":true}'
|
70
|
+
http_version:
|
71
|
+
recorded_at: Wed, 16 Sep 2020 17:47:47 GMT
|
72
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,73 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/passwordless/sessions/session_123/send
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
User-Agent:
|
17
|
+
- WorkOS; ruby/2.7.1; x86_64-darwin19; v0.7.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer sk_4q5ka3d9bx0XJiZhkKmUIOG87
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 422
|
23
|
+
message: Unprocessable Entity
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- Cowboy
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Vary:
|
30
|
+
- Origin, Accept-Encoding
|
31
|
+
Access-Control-Allow-Credentials:
|
32
|
+
- 'true'
|
33
|
+
Content-Security-Policy:
|
34
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
35
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
36
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
37
|
+
X-Dns-Prefetch-Control:
|
38
|
+
- 'off'
|
39
|
+
Expect-Ct:
|
40
|
+
- max-age=0
|
41
|
+
X-Frame-Options:
|
42
|
+
- SAMEORIGIN
|
43
|
+
Strict-Transport-Security:
|
44
|
+
- max-age=15552000; includeSubDomains
|
45
|
+
X-Download-Options:
|
46
|
+
- noopen
|
47
|
+
X-Content-Type-Options:
|
48
|
+
- nosniff
|
49
|
+
X-Permitted-Cross-Domain-Policies:
|
50
|
+
- none
|
51
|
+
Referrer-Policy:
|
52
|
+
- no-referrer
|
53
|
+
X-Xss-Protection:
|
54
|
+
- '0'
|
55
|
+
X-Request-Id:
|
56
|
+
- 6c22578f-9d49-4118-a7bd-18014d447aad
|
57
|
+
Content-Type:
|
58
|
+
- application/json; charset=utf-8
|
59
|
+
Content-Length:
|
60
|
+
- '79'
|
61
|
+
Etag:
|
62
|
+
- W/"4f-NjqaLicbRDM9SfS5gYKHlSgozt0"
|
63
|
+
Date:
|
64
|
+
- Wed, 16 Sep 2020 17:52:24 GMT
|
65
|
+
Via:
|
66
|
+
- 1.1 vegur
|
67
|
+
body:
|
68
|
+
encoding: UTF-8
|
69
|
+
string: '{"message":"The passwordless session ''session_123'' has expired or
|
70
|
+
is invalid."}'
|
71
|
+
http_version:
|
72
|
+
recorded_at: Wed, 16 Sep 2020 17:52:24 GMT
|
73
|
+
recorded_with: VCR 5.0.0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WorkOS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|
@@ -214,6 +214,7 @@ files:
|
|
214
214
|
- lib/workos/directory_sync.rb
|
215
215
|
- lib/workos/errors.rb
|
216
216
|
- lib/workos/organization.rb
|
217
|
+
- lib/workos/passwordless.rb
|
217
218
|
- lib/workos/portal.rb
|
218
219
|
- lib/workos/profile.rb
|
219
220
|
- lib/workos/sso.rb
|
@@ -222,6 +223,7 @@ files:
|
|
222
223
|
- lib/workos/types/intent_enum.rb
|
223
224
|
- lib/workos/types/list_struct.rb
|
224
225
|
- lib/workos/types/organization_struct.rb
|
226
|
+
- lib/workos/types/passwordless_session_struct.rb
|
225
227
|
- lib/workos/types/profile_struct.rb
|
226
228
|
- lib/workos/types/provider_enum.rb
|
227
229
|
- lib/workos/version.rb
|
@@ -237,6 +239,7 @@ files:
|
|
237
239
|
- spec/lib/workos/audit_trail_spec.rb
|
238
240
|
- spec/lib/workos/base_spec.rb
|
239
241
|
- spec/lib/workos/directory_sync_spec.rb
|
242
|
+
- spec/lib/workos/passwordless_spec.rb
|
240
243
|
- spec/lib/workos/portal_spec.rb
|
241
244
|
- spec/lib/workos/sso_spec.rb
|
242
245
|
- spec/spec_helper.rb
|
@@ -260,6 +263,10 @@ files:
|
|
260
263
|
- spec/support/fixtures/vcr_cassettes/organization/create.yml
|
261
264
|
- spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml
|
262
265
|
- spec/support/fixtures/vcr_cassettes/organization/list.yml
|
266
|
+
- spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml
|
267
|
+
- spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml
|
268
|
+
- spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml
|
269
|
+
- spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml
|
263
270
|
- spec/support/fixtures/vcr_cassettes/portal/generate_link.yml
|
264
271
|
- spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml
|
265
272
|
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_invalid_source.yml
|
@@ -294,6 +301,7 @@ test_files:
|
|
294
301
|
- spec/lib/workos/audit_trail_spec.rb
|
295
302
|
- spec/lib/workos/base_spec.rb
|
296
303
|
- spec/lib/workos/directory_sync_spec.rb
|
304
|
+
- spec/lib/workos/passwordless_spec.rb
|
297
305
|
- spec/lib/workos/portal_spec.rb
|
298
306
|
- spec/lib/workos/sso_spec.rb
|
299
307
|
- spec/spec_helper.rb
|
@@ -317,6 +325,10 @@ test_files:
|
|
317
325
|
- spec/support/fixtures/vcr_cassettes/organization/create.yml
|
318
326
|
- spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml
|
319
327
|
- spec/support/fixtures/vcr_cassettes/organization/list.yml
|
328
|
+
- spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml
|
329
|
+
- spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml
|
330
|
+
- spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml
|
331
|
+
- spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml
|
320
332
|
- spec/support/fixtures/vcr_cassettes/portal/generate_link.yml
|
321
333
|
- spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml
|
322
334
|
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_invalid_source.yml
|