workos 5.13.0 → 5.15.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: a70c9c63f286f0ec63436cc9d4d04d20f0cab14cffc5946bfb3e9725db014f7a
4
- data.tar.gz: b3ed8ecca83aad20d9a91674c27066ecb2a8019b4cd43173cfad01c10195653a
3
+ metadata.gz: 871af49aaa91bda4ef8ed6cd6479f5855dfe52bdbdc03d7a8cb84f3d0e11f9a2
4
+ data.tar.gz: fb3bf68d67de00de307abce4b445409669caf263c66b1b1c1a0cb602d33178ba
5
5
  SHA512:
6
- metadata.gz: 55692378591903208dd90c471d38eca8a0597adecac109329a277688ad92275e573e9d7110f3a8e58e06c0d78c3134e52e0924ca42e036bef01d337ef00bdde3
7
- data.tar.gz: edc0f7070cb311f43d7d77e6ae29e1afeb6695a04a85b9c6ac50cdd733fb0ae4dbc317ca88d2f468ef0f434e8551904a558ad70fad1857ab3bbb7c0362ea9fe3
6
+ metadata.gz: 1a3d8dc580bdffa940144de274775e8fe29b88a35ee0d6db0b2f47b44307a1b9431caca2f611ff26f0808dada9bad049716590c3a2d824a65eb111e71590fb66
7
+ data.tar.gz: fec16fc1694cefb315caa7699d2386ed9b6a2f678891c20bd2ff1c393cd2d69abb1bff51c0155a25cbdc8d1ed9b490c2bd954050e612abc9fca0622ed2fe3c91
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (5.13.0)
4
+ workos (5.15.0)
5
5
  encryptor (~> 3.0)
6
6
  jwt (~> 2.8)
7
7
 
@@ -7,11 +7,12 @@ module WorkOS
7
7
  module Intent
8
8
  AUDIT_LOGS = 'audit_logs'
9
9
  CERTIFICATE_RENEWAL = 'certificate_renewal'
10
+ DOMAIN_VERIFICATION = 'domain_verification'
10
11
  DSYNC = 'dsync'
11
12
  LOG_STREAMS = 'log_streams'
12
13
  SSO = 'sso'
13
14
 
14
- ALL = [AUDIT_LOGS, CERTIFICATE_RENEWAL, DSYNC, LOG_STREAMS, SSO].freeze
15
+ ALL = [AUDIT_LOGS, CERTIFICATE_RENEWAL, DOMAIN_VERIFICATION, DSYNC, LOG_STREAMS, SSO].freeze
15
16
  end
16
17
  end
17
18
  end
data/lib/workos/user.rb CHANGED
@@ -8,7 +8,7 @@ module WorkOS
8
8
  include HashProvider
9
9
 
10
10
  attr_accessor :id, :email, :first_name, :last_name, :email_verified,
11
- :profile_picture_url, :created_at, :updated_at
11
+ :profile_picture_url, :last_sign_in_at, :created_at, :updated_at
12
12
 
13
13
  def initialize(json)
14
14
  hash = JSON.parse(json, symbolize_names: true)
@@ -19,6 +19,7 @@ module WorkOS
19
19
  @last_name = hash[:last_name]
20
20
  @email_verified = hash[:email_verified]
21
21
  @profile_picture_url = hash[:profile_picture_url]
22
+ @last_sign_in_at = hash[:last_sign_in_at]
22
23
  @created_at = hash[:created_at]
23
24
  @updated_at = hash[:updated_at]
24
25
  end
@@ -31,6 +32,7 @@ module WorkOS
31
32
  last_name: last_name,
32
33
  email_verified: email_verified,
33
34
  profile_picture_url: profile_picture_url,
35
+ last_sign_in_at: last_sign_in_at,
34
36
  created_at: created_at,
35
37
  updated_at: updated_at,
36
38
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WorkOS
4
- VERSION = '5.13.0'
4
+ VERSION = '5.15.0'
5
5
  end
@@ -68,6 +68,21 @@ describe WorkOS::Portal do
68
68
  end
69
69
  end
70
70
 
71
+ describe 'with the domain_verification intent' do
72
+ it 'returns an Admin Portal link' do
73
+ VCR.use_cassette 'portal/generate_link_domain_verification', match_requests_on: %i[path body] do
74
+ portal_link = described_class.generate_link(
75
+ intent: 'domain_verification',
76
+ organization: organization,
77
+ )
78
+
79
+ expect(portal_link).to eq(
80
+ 'https://id.workos.com/portal/launch?secret=secret',
81
+ )
82
+ end
83
+ end
84
+ end
85
+
71
86
  describe 'with an invalid organization' do
72
87
  it 'raises an error' do
73
88
  VCR.use_cassette 'portal/generate_link_invalid' do
@@ -229,6 +229,12 @@ describe WorkOS::UserManagement do
229
229
 
230
230
  expect(user.id.instance_of?(String))
231
231
  expect(user.instance_of?(WorkOS::User))
232
+ expect(user.first_name).to eq('Bob')
233
+ expect(user.last_name).to eq('Loblaw')
234
+ expect(user.email).to eq('bob@example.com')
235
+ expect(user.email_verified).to eq(false)
236
+ expect(user.profile_picture_url).to eq(nil)
237
+ expect(user.last_sign_in_at).to eq('2024-02-06T23:13:18.137Z')
232
238
  end
233
239
  end
234
240
  end
@@ -0,0 +1,72 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/portal/generate_link
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"intent":"domain_verification","organization":"org_01EHQMYV6MBK39QC5PZXHY59C3","return_url":null,"success_url":null}'
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.5.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
+ - cb9ad5cf-243a-4084-a4f6-2d7d2b097b8b
57
+ Content-Type:
58
+ - application/json; charset=utf-8
59
+ Content-Length:
60
+ - '79'
61
+ Etag:
62
+ - W/"4f-NN86NUZRu/GQgPAYTexTS6/9DnM"
63
+ Date:
64
+ - Wed, 09 Sep 2020 23:43:07 GMT
65
+ Via:
66
+ - 1.1 vegur
67
+ body:
68
+ encoding: UTF-8
69
+ string: '{"link":"https://id.workos.com/portal/launch?secret=secret"}'
70
+ http_version:
71
+ recorded_at: Wed, 09 Sep 2020 23:43:07 GMT
72
+ recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: ASCII-8BIT
79
- string: '{"object":"user","id":"user_01HP0B4ZV2FWWVY0BF16GFDAER","email":"bob@example.com","email_verified":false,"first_name":"Bob","last_name":"Loblaw","profile_picture_url":null,"created_at":"2024-02-06T23:13:18.137Z","updated_at":"2024-02-06T23:13:36.946Z"}'
79
+ string: '{"object":"user","id":"user_01HP0B4ZV2FWWVY0BF16GFDAER","email":"bob@example.com","email_verified":false,"first_name":"Bob","last_name":"Loblaw","profile_picture_url":null,"last_sign_in_at":"2024-02-06T23:13:18.137Z","created_at":"2024-02-06T23:13:18.137Z","updated_at":"2024-02-06T23:13:36.946Z"}'
80
80
  http_version:
81
81
  recorded_at: Tue, 06 Feb 2024 23:16:59 GMT
82
82
  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: 5.13.0
4
+ version: 5.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WorkOS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-28 00:00:00.000000000 Z
11
+ date: 2025-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: encryptor
@@ -281,6 +281,7 @@ files:
281
281
  - spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml
282
282
  - spec/support/fixtures/vcr_cassettes/portal/generate_link_audit_logs.yml
283
283
  - spec/support/fixtures/vcr_cassettes/portal/generate_link_certificate_renewal.yml
284
+ - spec/support/fixtures/vcr_cassettes/portal/generate_link_domain_verification.yml
284
285
  - spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml
285
286
  - spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml
286
287
  - spec/support/fixtures/vcr_cassettes/portal/generate_link_sso.yml
@@ -502,6 +503,7 @@ test_files:
502
503
  - spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml
503
504
  - spec/support/fixtures/vcr_cassettes/portal/generate_link_audit_logs.yml
504
505
  - spec/support/fixtures/vcr_cassettes/portal/generate_link_certificate_renewal.yml
506
+ - spec/support/fixtures/vcr_cassettes/portal/generate_link_domain_verification.yml
505
507
  - spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml
506
508
  - spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml
507
509
  - spec/support/fixtures/vcr_cassettes/portal/generate_link_sso.yml