workos 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -2
  3. data/Gemfile.lock +6 -2
  4. data/README.md +179 -8
  5. data/bin/docs +2 -2
  6. data/codecov.yml +1 -0
  7. data/docs/WorkOS.html +22 -26
  8. data/docs/WorkOS/APIError.html +160 -0
  9. data/docs/WorkOS/AuditLog.html +235 -0
  10. data/docs/WorkOS/AuthenticationError.html +160 -0
  11. data/docs/WorkOS/Base.html +27 -32
  12. data/docs/WorkOS/Client.html +493 -0
  13. data/docs/WorkOS/InvalidRequestError.html +160 -0
  14. data/docs/WorkOS/Profile.html +80 -17
  15. data/docs/WorkOS/RequestError.html +6 -6
  16. data/docs/WorkOS/SSO.html +118 -74
  17. data/docs/WorkOS/Types.html +9 -10
  18. data/docs/WorkOS/Types/ProfileStruct.html +6 -6
  19. data/docs/WorkOS/Types/Provider.html +135 -0
  20. data/docs/WorkOS/WorkOSError.html +447 -0
  21. data/docs/class_list.html +3 -3
  22. data/docs/css/style.css +2 -2
  23. data/docs/file.README.html +173 -13
  24. data/docs/file_list.html +2 -2
  25. data/docs/frames.html +2 -2
  26. data/docs/index.html +77 -16
  27. data/docs/js/app.js +14 -3
  28. data/docs/method_list.html +96 -8
  29. data/docs/top-level-namespace.html +6 -6
  30. data/lib/workos.rb +7 -2
  31. data/lib/workos/audit_log.rb +78 -0
  32. data/lib/workos/base.rb +5 -6
  33. data/lib/workos/client.rb +86 -0
  34. data/lib/workos/errors.rb +48 -0
  35. data/lib/workos/sso.rb +49 -27
  36. data/lib/workos/types.rb +2 -1
  37. data/lib/workos/types/provider_enum.rb +14 -0
  38. data/lib/workos/version.rb +2 -2
  39. data/sorbet/rbi/hidden-definitions/errors.txt +22108 -4368
  40. data/sorbet/rbi/hidden-definitions/hidden.rbi +32490 -6059
  41. data/sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi +1 -1
  42. data/sorbet/rbi/todo.rbi +5 -0
  43. data/spec/lib/workos/audit_log_spec.rb +140 -0
  44. data/spec/lib/workos/base_spec.rb +30 -0
  45. data/spec/lib/workos/sso_spec.rb +131 -36
  46. data/spec/spec_helper.rb +21 -1
  47. data/spec/support/fixtures/vcr_cassettes/audit_log/create_event.yml +65 -0
  48. data/spec/support/fixtures/vcr_cassettes/audit_log/create_event_custom_idempotency_key.yml +67 -0
  49. data/spec/support/fixtures/vcr_cassettes/audit_log/create_event_invalid.yml +68 -0
  50. data/spec/support/fixtures/vcr_cassettes/audit_log/create_events_duplicate_idempotency_key_and_payload.yml +131 -0
  51. data/spec/support/fixtures/vcr_cassettes/audit_log/create_events_duplicate_idempotency_key_different_payload.yml +134 -0
  52. data/spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml +66 -0
  53. data/workos.gemspec +2 -0
  54. metadata +57 -27
  55. data/lib/workos/request_error.rb +0 -5
  56. data/sorbet/rbi/gems/addressable.rbi +0 -198
  57. data/sorbet/rbi/gems/ast.rbi +0 -47
  58. data/sorbet/rbi/gems/codecov.rbi +0 -19
  59. data/sorbet/rbi/gems/crack.rbi +0 -47
  60. data/sorbet/rbi/gems/docile.rbi +0 -31
  61. data/sorbet/rbi/gems/hashdiff.rbi +0 -65
  62. data/sorbet/rbi/gems/jaro_winkler.rbi +0 -14
  63. data/sorbet/rbi/gems/parallel.rbi +0 -81
  64. data/sorbet/rbi/gems/parser.rbi +0 -856
  65. data/sorbet/rbi/gems/public_suffix.rbi +0 -102
  66. data/sorbet/rbi/gems/rack.rbi +0 -103
  67. data/sorbet/rbi/gems/rainbow.rbi +0 -117
  68. data/sorbet/rbi/gems/rake.rbi +0 -632
  69. data/sorbet/rbi/gems/rspec-core.rbi +0 -1661
  70. data/sorbet/rbi/gems/rspec-expectations.rbi +0 -388
  71. data/sorbet/rbi/gems/rspec-mocks.rbi +0 -823
  72. data/sorbet/rbi/gems/rspec-support.rbi +0 -266
  73. data/sorbet/rbi/gems/rspec.rbi +0 -14
  74. data/sorbet/rbi/gems/rubocop.rbi +0 -7083
  75. data/sorbet/rbi/gems/ruby-progressbar.rbi +0 -304
  76. data/sorbet/rbi/gems/simplecov-html.rbi +0 -30
  77. data/sorbet/rbi/gems/simplecov.rbi +0 -225
  78. data/sorbet/rbi/gems/unicode-display_width.rbi +0 -16
  79. data/sorbet/rbi/gems/webmock.rbi +0 -526
@@ -0,0 +1,65 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/events
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","action_type":"C","actor_name":"Daiki
9
+ Miyagi","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}'
10
+ headers:
11
+ Content-Type:
12
+ - application/json
13
+ Accept-Encoding:
14
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
15
+ Accept:
16
+ - "*/*"
17
+ User-Agent:
18
+ - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0
19
+ Authorization:
20
+ - Bearer <API_KEY>
21
+ response:
22
+ status:
23
+ code: 201
24
+ message: Created
25
+ headers:
26
+ Server:
27
+ - Cowboy
28
+ Connection:
29
+ - keep-alive
30
+ Access-Control-Allow-Origin:
31
+ - https://dashboard.workos.com
32
+ Vary:
33
+ - Origin, Accept-Encoding
34
+ Access-Control-Allow-Credentials:
35
+ - 'true'
36
+ X-Dns-Prefetch-Control:
37
+ - 'off'
38
+ X-Frame-Options:
39
+ - SAMEORIGIN
40
+ Strict-Transport-Security:
41
+ - max-age=15552000; includeSubDomains
42
+ X-Download-Options:
43
+ - noopen
44
+ X-Content-Type-Options:
45
+ - nosniff
46
+ X-Xss-Protection:
47
+ - 1; mode=block
48
+ X-Request-Id:
49
+ - b0aea387-fce0-446b-95e9-600dd869a8b0
50
+ Content-Type:
51
+ - application/json; charset=utf-8
52
+ Content-Length:
53
+ - '16'
54
+ Etag:
55
+ - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA"
56
+ Date:
57
+ - Sat, 11 Jan 2020 04:24:02 GMT
58
+ Via:
59
+ - 1.1 vegur
60
+ body:
61
+ encoding: UTF-8
62
+ string: '{"success":true}'
63
+ http_version:
64
+ recorded_at: Sat, 11 Jan 2020 04:24:02 GMT
65
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,67 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/events
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","action_type":"C","actor_name":"Daiki
9
+ Miyagi","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}'
10
+ headers:
11
+ Content-Type:
12
+ - application/json
13
+ Accept-Encoding:
14
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
15
+ Accept:
16
+ - "*/*"
17
+ User-Agent:
18
+ - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0
19
+ Authorization:
20
+ - Bearer <API_KEY>
21
+ Idempotency-Key:
22
+ - key
23
+ response:
24
+ status:
25
+ code: 201
26
+ message: Created
27
+ headers:
28
+ Server:
29
+ - Cowboy
30
+ Connection:
31
+ - keep-alive
32
+ Access-Control-Allow-Origin:
33
+ - https://dashboard.workos.com
34
+ Vary:
35
+ - Origin, Accept-Encoding
36
+ Access-Control-Allow-Credentials:
37
+ - 'true'
38
+ X-Dns-Prefetch-Control:
39
+ - 'off'
40
+ X-Frame-Options:
41
+ - SAMEORIGIN
42
+ Strict-Transport-Security:
43
+ - max-age=15552000; includeSubDomains
44
+ X-Download-Options:
45
+ - noopen
46
+ X-Content-Type-Options:
47
+ - nosniff
48
+ X-Xss-Protection:
49
+ - 1; mode=block
50
+ X-Request-Id:
51
+ - 1cf9b8e7-5910-4a6d-a333-46bcf841422e
52
+ Content-Type:
53
+ - application/json; charset=utf-8
54
+ Content-Length:
55
+ - '16'
56
+ Etag:
57
+ - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA"
58
+ Date:
59
+ - Sat, 11 Jan 2020 04:22:48 GMT
60
+ Via:
61
+ - 1.1 vegur
62
+ body:
63
+ encoding: UTF-8
64
+ string: '{"success":true}'
65
+ http_version:
66
+ recorded_at: Sat, 11 Jan 2020 04:22:48 GMT
67
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,68 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/events
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","actor_name":"Daiki
9
+ Miyagi","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}'
10
+ headers:
11
+ Content-Type:
12
+ - application/json
13
+ Accept-Encoding:
14
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
15
+ Accept:
16
+ - "*/*"
17
+ User-Agent:
18
+ - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0
19
+ Authorization:
20
+ - Bearer <API_KEY>
21
+ response:
22
+ status:
23
+ code: 422
24
+ message: Unprocessable Entity
25
+ headers:
26
+ Server:
27
+ - Cowboy
28
+ Connection:
29
+ - keep-alive
30
+ Access-Control-Allow-Origin:
31
+ - https://dashboard.workos.com
32
+ Vary:
33
+ - Origin, Accept-Encoding
34
+ Access-Control-Allow-Credentials:
35
+ - 'true'
36
+ X-Dns-Prefetch-Control:
37
+ - 'off'
38
+ X-Frame-Options:
39
+ - SAMEORIGIN
40
+ Strict-Transport-Security:
41
+ - max-age=15552000; includeSubDomains
42
+ X-Download-Options:
43
+ - noopen
44
+ X-Content-Type-Options:
45
+ - nosniff
46
+ X-Xss-Protection:
47
+ - 1; mode=block
48
+ X-Request-Id:
49
+ - b5e5033d-4d6c-4459-9018-4746be643113
50
+ Request-Id:
51
+ - b5e5033d-4d6c-4459-9018-4746be643113
52
+ Content-Type:
53
+ - application/json; charset=utf-8
54
+ Content-Length:
55
+ - '104'
56
+ Etag:
57
+ - W/"68-JY6dzr9lnqlivbnfVxCBKwKt3Zc"
58
+ Date:
59
+ - Sat, 11 Jan 2020 02:32:14 GMT
60
+ Via:
61
+ - 1.1 vegur
62
+ body:
63
+ encoding: UTF-8
64
+ string: '{"message":"Validation failed","errors":[{"field":"action_type","code":"action_type
65
+ must be a string"}]}'
66
+ http_version:
67
+ recorded_at: Sat, 11 Jan 2020 02:32:14 GMT
68
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,131 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/events
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","action_type":"C","actor_name":"Daiki
9
+ Miyagi","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}'
10
+ headers:
11
+ Content-Type:
12
+ - application/json
13
+ Accept-Encoding:
14
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
15
+ Accept:
16
+ - "*/*"
17
+ User-Agent:
18
+ - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0
19
+ Authorization:
20
+ - Bearer <API_KEY>
21
+ Idempotency-Key:
22
+ - foo
23
+ response:
24
+ status:
25
+ code: 201
26
+ message: Created
27
+ headers:
28
+ Server:
29
+ - Cowboy
30
+ Connection:
31
+ - keep-alive
32
+ Access-Control-Allow-Origin:
33
+ - https://dashboard.workos.com
34
+ Vary:
35
+ - Origin, Accept-Encoding
36
+ Access-Control-Allow-Credentials:
37
+ - 'true'
38
+ X-Dns-Prefetch-Control:
39
+ - 'off'
40
+ X-Frame-Options:
41
+ - SAMEORIGIN
42
+ Strict-Transport-Security:
43
+ - max-age=15552000; includeSubDomains
44
+ X-Download-Options:
45
+ - noopen
46
+ X-Content-Type-Options:
47
+ - nosniff
48
+ X-Xss-Protection:
49
+ - 1; mode=block
50
+ X-Request-Id:
51
+ - 495fd4e3-a66c-4154-8922-22fb3fb1f809
52
+ Content-Type:
53
+ - application/json; charset=utf-8
54
+ Content-Length:
55
+ - '16'
56
+ Etag:
57
+ - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA"
58
+ Date:
59
+ - Sat, 11 Jan 2020 04:25:32 GMT
60
+ Via:
61
+ - 1.1 vegur
62
+ body:
63
+ encoding: UTF-8
64
+ string: '{"success":true}'
65
+ http_version:
66
+ recorded_at: Sat, 11 Jan 2020 04:25:32 GMT
67
+ - request:
68
+ method: post
69
+ uri: https://api.workos.com/events
70
+ body:
71
+ encoding: UTF-8
72
+ string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","action_type":"C","actor_name":"Daiki
73
+ Miyagi","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}'
74
+ headers:
75
+ Content-Type:
76
+ - application/json
77
+ Accept-Encoding:
78
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
79
+ Accept:
80
+ - "*/*"
81
+ User-Agent:
82
+ - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0
83
+ Authorization:
84
+ - Bearer <API_KEY>
85
+ Idempotency-Key:
86
+ - foo
87
+ response:
88
+ status:
89
+ code: 201
90
+ message: Created
91
+ headers:
92
+ Server:
93
+ - Cowboy
94
+ Connection:
95
+ - keep-alive
96
+ Access-Control-Allow-Origin:
97
+ - https://dashboard.workos.com
98
+ Vary:
99
+ - Origin, Accept-Encoding
100
+ Access-Control-Allow-Credentials:
101
+ - 'true'
102
+ X-Dns-Prefetch-Control:
103
+ - 'off'
104
+ X-Frame-Options:
105
+ - SAMEORIGIN
106
+ Strict-Transport-Security:
107
+ - max-age=15552000; includeSubDomains
108
+ X-Download-Options:
109
+ - noopen
110
+ X-Content-Type-Options:
111
+ - nosniff
112
+ X-Xss-Protection:
113
+ - 1; mode=block
114
+ X-Request-Id:
115
+ - 66cf2a20-65a5-47ae-94f9-fd215f1705a3
116
+ Content-Type:
117
+ - application/json; charset=utf-8
118
+ Content-Length:
119
+ - '16'
120
+ Etag:
121
+ - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA"
122
+ Date:
123
+ - Sat, 11 Jan 2020 04:25:32 GMT
124
+ Via:
125
+ - 1.1 vegur
126
+ body:
127
+ encoding: UTF-8
128
+ string: '{"success":true}'
129
+ http_version:
130
+ recorded_at: Sat, 11 Jan 2020 04:25:32 GMT
131
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,134 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/events
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","action_type":"C","actor_name":"Daiki
9
+ Miyagi","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}'
10
+ headers:
11
+ Content-Type:
12
+ - application/json
13
+ Accept-Encoding:
14
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
15
+ Accept:
16
+ - "*/*"
17
+ User-Agent:
18
+ - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0
19
+ Authorization:
20
+ - Bearer <API_KEY>
21
+ Idempotency-Key:
22
+ - bar
23
+ response:
24
+ status:
25
+ code: 201
26
+ message: Created
27
+ headers:
28
+ Server:
29
+ - Cowboy
30
+ Connection:
31
+ - keep-alive
32
+ Access-Control-Allow-Origin:
33
+ - https://dashboard.workos.com
34
+ Vary:
35
+ - Origin, Accept-Encoding
36
+ Access-Control-Allow-Credentials:
37
+ - 'true'
38
+ X-Dns-Prefetch-Control:
39
+ - 'off'
40
+ X-Frame-Options:
41
+ - SAMEORIGIN
42
+ Strict-Transport-Security:
43
+ - max-age=15552000; includeSubDomains
44
+ X-Download-Options:
45
+ - noopen
46
+ X-Content-Type-Options:
47
+ - nosniff
48
+ X-Xss-Protection:
49
+ - 1; mode=block
50
+ X-Request-Id:
51
+ - fb5891e8-eb0c-4257-b476-c5aea60623c3
52
+ Content-Type:
53
+ - application/json; charset=utf-8
54
+ Content-Length:
55
+ - '16'
56
+ Etag:
57
+ - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA"
58
+ Date:
59
+ - Sat, 11 Jan 2020 04:48:06 GMT
60
+ Via:
61
+ - 1.1 vegur
62
+ body:
63
+ encoding: UTF-8
64
+ string: '{"success":true}'
65
+ http_version:
66
+ recorded_at: Sat, 11 Jan 2020 04:48:06 GMT
67
+ - request:
68
+ method: post
69
+ uri: https://api.workos.com/events
70
+ body:
71
+ encoding: UTF-8
72
+ string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","action_type":"C","actor_name":"Tetsuya
73
+ Sugaya","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}'
74
+ headers:
75
+ Content-Type:
76
+ - application/json
77
+ Accept-Encoding:
78
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
79
+ Accept:
80
+ - "*/*"
81
+ User-Agent:
82
+ - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0
83
+ Authorization:
84
+ - Bearer <API_KEY>
85
+ Idempotency-Key:
86
+ - bar
87
+ response:
88
+ status:
89
+ code: 400
90
+ message: Bad Request
91
+ headers:
92
+ Server:
93
+ - Cowboy
94
+ Connection:
95
+ - keep-alive
96
+ Access-Control-Allow-Origin:
97
+ - https://dashboard.workos.com
98
+ Vary:
99
+ - Origin, Accept-Encoding
100
+ Access-Control-Allow-Credentials:
101
+ - 'true'
102
+ X-Dns-Prefetch-Control:
103
+ - 'off'
104
+ X-Frame-Options:
105
+ - SAMEORIGIN
106
+ Strict-Transport-Security:
107
+ - max-age=15552000; includeSubDomains
108
+ X-Download-Options:
109
+ - noopen
110
+ X-Content-Type-Options:
111
+ - nosniff
112
+ X-Xss-Protection:
113
+ - 1; mode=block
114
+ X-Request-Id:
115
+ - 3f060f0b-2c26-46c2-a2f8-76c4332e84aa
116
+ Request-Id:
117
+ - 3f060f0b-2c26-46c2-a2f8-76c4332e84aa
118
+ Content-Type:
119
+ - application/json; charset=utf-8
120
+ Content-Length:
121
+ - '128'
122
+ Etag:
123
+ - W/"80-jILfJK6SRXhN8oqz8Na6yutVwHM"
124
+ Date:
125
+ - Sat, 11 Jan 2020 04:48:06 GMT
126
+ Via:
127
+ - 1.1 vegur
128
+ body:
129
+ encoding: UTF-8
130
+ string: '{"message":"Another idempotency key (bar) with different request parameters
131
+ was found. Please use a different idempotency key."}'
132
+ http_version:
133
+ recorded_at: Sat, 11 Jan 2020 04:48:06 GMT
134
+ recorded_with: VCR 5.0.0