workos 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -2
- data/Gemfile.lock +6 -2
- data/README.md +179 -8
- data/bin/docs +2 -2
- data/codecov.yml +1 -0
- data/docs/WorkOS.html +22 -26
- data/docs/WorkOS/APIError.html +160 -0
- data/docs/WorkOS/AuditLog.html +235 -0
- data/docs/WorkOS/AuthenticationError.html +160 -0
- data/docs/WorkOS/Base.html +27 -32
- data/docs/WorkOS/Client.html +493 -0
- data/docs/WorkOS/InvalidRequestError.html +160 -0
- data/docs/WorkOS/Profile.html +80 -17
- data/docs/WorkOS/RequestError.html +6 -6
- data/docs/WorkOS/SSO.html +118 -74
- data/docs/WorkOS/Types.html +9 -10
- data/docs/WorkOS/Types/ProfileStruct.html +6 -6
- data/docs/WorkOS/Types/Provider.html +135 -0
- data/docs/WorkOS/WorkOSError.html +447 -0
- data/docs/class_list.html +3 -3
- data/docs/css/style.css +2 -2
- data/docs/file.README.html +173 -13
- data/docs/file_list.html +2 -2
- data/docs/frames.html +2 -2
- data/docs/index.html +77 -16
- data/docs/js/app.js +14 -3
- data/docs/method_list.html +96 -8
- data/docs/top-level-namespace.html +6 -6
- data/lib/workos.rb +7 -2
- data/lib/workos/audit_log.rb +78 -0
- data/lib/workos/base.rb +5 -6
- data/lib/workos/client.rb +86 -0
- data/lib/workos/errors.rb +48 -0
- data/lib/workos/sso.rb +49 -27
- data/lib/workos/types.rb +2 -1
- data/lib/workos/types/provider_enum.rb +14 -0
- data/lib/workos/version.rb +2 -2
- data/sorbet/rbi/hidden-definitions/errors.txt +22108 -4368
- data/sorbet/rbi/hidden-definitions/hidden.rbi +32490 -6059
- data/sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi +1 -1
- data/sorbet/rbi/todo.rbi +5 -0
- data/spec/lib/workos/audit_log_spec.rb +140 -0
- data/spec/lib/workos/base_spec.rb +30 -0
- data/spec/lib/workos/sso_spec.rb +131 -36
- data/spec/spec_helper.rb +21 -1
- data/spec/support/fixtures/vcr_cassettes/audit_log/create_event.yml +65 -0
- data/spec/support/fixtures/vcr_cassettes/audit_log/create_event_custom_idempotency_key.yml +67 -0
- data/spec/support/fixtures/vcr_cassettes/audit_log/create_event_invalid.yml +68 -0
- data/spec/support/fixtures/vcr_cassettes/audit_log/create_events_duplicate_idempotency_key_and_payload.yml +131 -0
- data/spec/support/fixtures/vcr_cassettes/audit_log/create_events_duplicate_idempotency_key_different_payload.yml +134 -0
- data/spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml +66 -0
- data/workos.gemspec +2 -0
- metadata +57 -27
- data/lib/workos/request_error.rb +0 -5
- data/sorbet/rbi/gems/addressable.rbi +0 -198
- data/sorbet/rbi/gems/ast.rbi +0 -47
- data/sorbet/rbi/gems/codecov.rbi +0 -19
- data/sorbet/rbi/gems/crack.rbi +0 -47
- data/sorbet/rbi/gems/docile.rbi +0 -31
- data/sorbet/rbi/gems/hashdiff.rbi +0 -65
- data/sorbet/rbi/gems/jaro_winkler.rbi +0 -14
- data/sorbet/rbi/gems/parallel.rbi +0 -81
- data/sorbet/rbi/gems/parser.rbi +0 -856
- data/sorbet/rbi/gems/public_suffix.rbi +0 -102
- data/sorbet/rbi/gems/rack.rbi +0 -103
- data/sorbet/rbi/gems/rainbow.rbi +0 -117
- data/sorbet/rbi/gems/rake.rbi +0 -632
- data/sorbet/rbi/gems/rspec-core.rbi +0 -1661
- data/sorbet/rbi/gems/rspec-expectations.rbi +0 -388
- data/sorbet/rbi/gems/rspec-mocks.rbi +0 -823
- data/sorbet/rbi/gems/rspec-support.rbi +0 -266
- data/sorbet/rbi/gems/rspec.rbi +0 -14
- data/sorbet/rbi/gems/rubocop.rbi +0 -7083
- data/sorbet/rbi/gems/ruby-progressbar.rbi +0 -304
- data/sorbet/rbi/gems/simplecov-html.rbi +0 -30
- data/sorbet/rbi/gems/simplecov.rbi +0 -225
- data/sorbet/rbi/gems/unicode-display_width.rbi +0 -16
- data/sorbet/rbi/gems/webmock.rbi +0 -526
@@ -0,0 +1,160 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Exception: WorkOS::InvalidRequestError
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.22
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "WorkOS::InvalidRequestError";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (I)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../WorkOS.html" title="WorkOS (module)">WorkOS</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">InvalidRequestError</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Exception: WorkOS::InvalidRequestError
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="WorkOSError.html" title="WorkOS::WorkOSError (class)">WorkOSError</a></span></span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">StandardError</li>
|
78
|
+
|
79
|
+
<li class="next"><span class='object_link'><a href="WorkOSError.html" title="WorkOS::WorkOSError (class)">WorkOSError</a></span></li>
|
80
|
+
|
81
|
+
<li class="next">WorkOS::InvalidRequestError</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<dl>
|
100
|
+
<dt>Defined in:</dt>
|
101
|
+
<dd>lib/workos/errors.rb</dd>
|
102
|
+
</dl>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<h2>Overview</h2><div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
|
109
|
+
<p>InvalidRequestError is raised when a request is initiated with invalid parameters.</p>
|
110
|
+
|
111
|
+
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
<div class="tags">
|
115
|
+
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<h2>Instance Attribute Summary</h2>
|
124
|
+
|
125
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="WorkOSError.html" title="WorkOS::WorkOSError (class)">WorkOSError</a></span></h3>
|
126
|
+
<p class="inherited"><span class='object_link'><a href="WorkOSError.html#http_status-instance_method" title="WorkOS::WorkOSError#http_status (method)">#http_status</a></span>, <span class='object_link'><a href="WorkOSError.html#request_id-instance_method" title="WorkOS::WorkOSError#request_id (method)">#request_id</a></span></p>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<h2>Method Summary</h2>
|
137
|
+
|
138
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="WorkOSError.html" title="WorkOS::WorkOSError (class)">WorkOSError</a></span></h3>
|
139
|
+
<p class="inherited"><span class='object_link'><a href="WorkOSError.html#initialize-instance_method" title="WorkOS::WorkOSError#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="WorkOSError.html#to_s-instance_method" title="WorkOS::WorkOSError#to_s (method)">#to_s</a></span></p>
|
140
|
+
|
141
|
+
|
142
|
+
<div id="constructor_details" class="method_details_list">
|
143
|
+
<h2>Constructor Details</h2>
|
144
|
+
|
145
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="WorkOSError.html#initialize-instance_method" title="WorkOS::WorkOSError#initialize (method)">WorkOS::WorkOSError</a></span></p>
|
146
|
+
|
147
|
+
</div>
|
148
|
+
|
149
|
+
|
150
|
+
</div>
|
151
|
+
|
152
|
+
<div id="footer">
|
153
|
+
Generated on Thu Jan 30 09:12:47 2020 by
|
154
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
155
|
+
0.9.22 (ruby-2.6.5).
|
156
|
+
</div>
|
157
|
+
|
158
|
+
</div>
|
159
|
+
</body>
|
160
|
+
</html>
|
data/docs/WorkOS/Profile.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Class: WorkOS::Profile
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.22
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "WorkOS::Profile";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
@@ -107,10 +107,7 @@
|
|
107
107
|
<h2>Overview</h2><div class="docstring">
|
108
108
|
<div class="discussion">
|
109
109
|
|
110
|
-
<p>The Profile class provides a lighweight wrapper around a normalized
|
111
|
-
response from the various IDPs WorkOS supports as part of the SSO
|
112
|
-
integration. This class is not meant ot be instantiated in user space, and
|
113
|
-
is instantiated internally but exposed.</p>
|
110
|
+
<p>The Profile class provides a lighweight wrapper around a normalized response from the various IDPs WorkOS supports as part of the SSO integration. This class is not meant ot be instantiated in user space, and is instantiated internally but exposed.</p>
|
114
111
|
|
115
112
|
|
116
113
|
</div>
|
@@ -345,6 +342,28 @@ is instantiated internally but exposed.</p>
|
|
345
342
|
<p>A new instance of Profile.</p>
|
346
343
|
</div></span>
|
347
344
|
|
345
|
+
</li>
|
346
|
+
|
347
|
+
|
348
|
+
<li class="public ">
|
349
|
+
<span class="summary_signature">
|
350
|
+
|
351
|
+
<a href="#to_json-instance_method" title="#to_json (instance method)">#<strong>to_json</strong> ⇒ Object </a>
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
</span>
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
366
|
+
|
348
367
|
</li>
|
349
368
|
|
350
369
|
|
@@ -367,7 +386,7 @@ is instantiated internally but exposed.</p>
|
|
367
386
|
</h3><div class="docstring">
|
368
387
|
<div class="discussion">
|
369
388
|
|
370
|
-
<p>Returns a new instance of Profile
|
389
|
+
<p>Returns a new instance of Profile.</p>
|
371
390
|
|
372
391
|
|
373
392
|
</div>
|
@@ -429,7 +448,7 @@ is instantiated internally but exposed.</p>
|
|
429
448
|
</h3><div class="docstring">
|
430
449
|
<div class="discussion">
|
431
450
|
|
432
|
-
<p>Returns the value of attribute connection_type
|
451
|
+
<p>Returns the value of attribute connection_type.</p>
|
433
452
|
|
434
453
|
|
435
454
|
</div>
|
@@ -472,7 +491,7 @@ is instantiated internally but exposed.</p>
|
|
472
491
|
</h3><div class="docstring">
|
473
492
|
<div class="discussion">
|
474
493
|
|
475
|
-
<p>Returns the value of attribute email
|
494
|
+
<p>Returns the value of attribute email.</p>
|
476
495
|
|
477
496
|
|
478
497
|
</div>
|
@@ -515,7 +534,7 @@ is instantiated internally but exposed.</p>
|
|
515
534
|
</h3><div class="docstring">
|
516
535
|
<div class="discussion">
|
517
536
|
|
518
|
-
<p>Returns the value of attribute first_name
|
537
|
+
<p>Returns the value of attribute first_name.</p>
|
519
538
|
|
520
539
|
|
521
540
|
</div>
|
@@ -558,7 +577,7 @@ is instantiated internally but exposed.</p>
|
|
558
577
|
</h3><div class="docstring">
|
559
578
|
<div class="discussion">
|
560
579
|
|
561
|
-
<p>Returns the value of attribute id
|
580
|
+
<p>Returns the value of attribute id.</p>
|
562
581
|
|
563
582
|
|
564
583
|
</div>
|
@@ -601,7 +620,7 @@ is instantiated internally but exposed.</p>
|
|
601
620
|
</h3><div class="docstring">
|
602
621
|
<div class="discussion">
|
603
622
|
|
604
|
-
<p>Returns the value of attribute idp_id
|
623
|
+
<p>Returns the value of attribute idp_id.</p>
|
605
624
|
|
606
625
|
|
607
626
|
</div>
|
@@ -644,7 +663,7 @@ is instantiated internally but exposed.</p>
|
|
644
663
|
</h3><div class="docstring">
|
645
664
|
<div class="discussion">
|
646
665
|
|
647
|
-
<p>Returns the value of attribute last_name
|
666
|
+
<p>Returns the value of attribute last_name.</p>
|
648
667
|
|
649
668
|
|
650
669
|
</div>
|
@@ -708,6 +727,50 @@ is instantiated internally but exposed.</p>
|
|
708
727
|
</td>
|
709
728
|
</tr>
|
710
729
|
</table>
|
730
|
+
</div>
|
731
|
+
|
732
|
+
<div class="method_details ">
|
733
|
+
<h3 class="signature " id="to_json-instance_method">
|
734
|
+
|
735
|
+
#<strong>to_json</strong> ⇒ <tt>Object</tt>
|
736
|
+
|
737
|
+
|
738
|
+
|
739
|
+
|
740
|
+
|
741
|
+
</h3><table class="source_code">
|
742
|
+
<tr>
|
743
|
+
<td>
|
744
|
+
<pre class="lines">
|
745
|
+
|
746
|
+
|
747
|
+
37
|
748
|
+
38
|
749
|
+
39
|
750
|
+
40
|
751
|
+
41
|
752
|
+
42
|
753
|
+
43
|
754
|
+
44
|
755
|
+
45
|
756
|
+
46</pre>
|
757
|
+
</td>
|
758
|
+
<td>
|
759
|
+
<pre class="code"><span class="info file"># File 'lib/workos/profile.rb', line 37</span>
|
760
|
+
|
761
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_json'>to_json</span><span class='lparen'>(</span><span class='op'>*</span><span class='rparen'>)</span>
|
762
|
+
<span class='lbrace'>{</span>
|
763
|
+
<span class='label'>id:</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span>
|
764
|
+
<span class='label'>email:</span> <span class='id identifier rubyid_email'>email</span><span class='comma'>,</span>
|
765
|
+
<span class='label'>first_name:</span> <span class='id identifier rubyid_first_name'>first_name</span><span class='comma'>,</span>
|
766
|
+
<span class='label'>last_name:</span> <span class='id identifier rubyid_last_name'>last_name</span><span class='comma'>,</span>
|
767
|
+
<span class='label'>connection_type:</span> <span class='id identifier rubyid_connection_type'>connection_type</span><span class='comma'>,</span>
|
768
|
+
<span class='label'>idp_id:</span> <span class='id identifier rubyid_idp_id'>idp_id</span><span class='comma'>,</span>
|
769
|
+
<span class='rbrace'>}</span>
|
770
|
+
<span class='kw'>end</span></pre>
|
771
|
+
</td>
|
772
|
+
</tr>
|
773
|
+
</table>
|
711
774
|
</div>
|
712
775
|
|
713
776
|
</div>
|
@@ -715,9 +778,9 @@ is instantiated internally but exposed.</p>
|
|
715
778
|
</div>
|
716
779
|
|
717
780
|
<div id="footer">
|
718
|
-
Generated on
|
781
|
+
Generated on Thu Jan 30 09:12:47 2020 by
|
719
782
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
720
|
-
0.9.
|
783
|
+
0.9.22 (ruby-2.6.5).
|
721
784
|
</div>
|
722
785
|
|
723
786
|
</div>
|
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Exception: WorkOS::RequestError
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.22
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "WorkOS::RequestError";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
@@ -125,9 +125,9 @@
|
|
125
125
|
</div>
|
126
126
|
|
127
127
|
<div id="footer">
|
128
|
-
Generated on
|
128
|
+
Generated on Thu Jan 2 17:24:40 2020 by
|
129
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
130
|
-
0.9.
|
130
|
+
0.9.22 (ruby-2.3.7).
|
131
131
|
</div>
|
132
132
|
|
133
133
|
</div>
|
data/docs/WorkOS/SSO.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Module: WorkOS::SSO
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.22
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "WorkOS::SSO";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
@@ -71,7 +71,7 @@
|
|
71
71
|
|
72
72
|
<dl>
|
73
73
|
<dt>Extended by:</dt>
|
74
|
-
<dd>T::Sig</dd>
|
74
|
+
<dd>T::Sig, <span class='object_link'><a href="Base.html" title="WorkOS::Base (module)">Base</a></span>, <span class='object_link'><a href="Client.html" title="WorkOS::Client (module)">Client</a></span></dd>
|
75
75
|
</dl>
|
76
76
|
|
77
77
|
|
@@ -91,9 +91,7 @@
|
|
91
91
|
<h2>Overview</h2><div class="docstring">
|
92
92
|
<div class="discussion">
|
93
93
|
|
94
|
-
<p>The SSO module provides convenience methods for working with the WorkOS SSO
|
95
|
-
service. You'll need a valid API key, a project ID, and to have created
|
96
|
-
an SSO connection on your WorkOS dashboard.</p>
|
94
|
+
<p>The SSO module provides convenience methods for working with the WorkOS SSO platform. You'll need a valid API key, a project ID, and to have created an SSO connection on your WorkOS dashboard.</p>
|
97
95
|
|
98
96
|
|
99
97
|
</div>
|
@@ -109,12 +107,33 @@ an SSO connection on your WorkOS dashboard.</p>
|
|
109
107
|
</ul>
|
110
108
|
|
111
109
|
</div>
|
110
|
+
|
111
|
+
<h2>
|
112
|
+
Constant Summary
|
113
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
114
|
+
</h2>
|
115
|
+
|
116
|
+
<dl class="constants">
|
117
|
+
|
118
|
+
<dt id="PROVIDERS-constant" class="">PROVIDERS =
|
119
|
+
|
120
|
+
</dt>
|
121
|
+
<dd><pre class="code"><span class='const'><span class='object_link'><a href="../WorkOS.html" title="WorkOS (module)">WorkOS</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Types.html" title="WorkOS::Types (module)">Types</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Types/Provider.html" title="WorkOS::Types::Provider (class)">Provider</a></span></span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:serialize</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
122
|
+
|
123
|
+
</dl>
|
124
|
+
|
112
125
|
|
113
126
|
|
114
127
|
|
115
128
|
|
116
129
|
|
117
130
|
|
131
|
+
<h2>Instance Attribute Summary</h2>
|
132
|
+
|
133
|
+
<h3 class="inherited">Attributes included from <span class='object_link'><a href="Base.html" title="WorkOS::Base (module)">Base</a></span></h3>
|
134
|
+
<p class="inherited"><span class='object_link'><a href="Base.html#key-instance_method" title="WorkOS::Base#key (method)">#key</a></span></p>
|
135
|
+
|
136
|
+
|
118
137
|
|
119
138
|
<h2>
|
120
139
|
Class Method Summary
|
@@ -126,7 +145,7 @@ an SSO connection on your WorkOS dashboard.</p>
|
|
126
145
|
<li class="public ">
|
127
146
|
<span class="summary_signature">
|
128
147
|
|
129
|
-
<a href="#authorization_url-class_method" title="authorization_url (class method)">.<strong>authorization_url</strong>(
|
148
|
+
<a href="#authorization_url-class_method" title="authorization_url (class method)">.<strong>authorization_url</strong>(project_id:, redirect_uri:, domain: nil, provider: nil, state: {}) ⇒ String </a>
|
130
149
|
|
131
150
|
|
132
151
|
|
@@ -141,8 +160,7 @@ an SSO connection on your WorkOS dashboard.</p>
|
|
141
160
|
|
142
161
|
|
143
162
|
<span class="summary_desc"><div class='inline'>
|
144
|
-
<p>Generate an Oauth2 authorization URL where your users will authenticate
|
145
|
-
using the configured SSO Identity Provider.</p>
|
163
|
+
<p>Generate an Oauth2 authorization URL where your users will authenticate using the configured SSO Identity Provider.</p>
|
146
164
|
</div></span>
|
147
165
|
|
148
166
|
</li>
|
@@ -151,7 +169,7 @@ using the configured SSO Identity Provider.</p>
|
|
151
169
|
<li class="public ">
|
152
170
|
<span class="summary_signature">
|
153
171
|
|
154
|
-
<a href="#profile-class_method" title="profile (class method)">.<strong>profile</strong>(code:, project_id
|
172
|
+
<a href="#profile-class_method" title="profile (class method)">.<strong>profile</strong>(code:, project_id:) ⇒ WorkOS::Profile </a>
|
155
173
|
|
156
174
|
|
157
175
|
|
@@ -177,6 +195,26 @@ using the configured SSO Identity Provider.</p>
|
|
177
195
|
|
178
196
|
|
179
197
|
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Client.html" title="WorkOS::Client (module)">Client</a></span></h3>
|
206
|
+
<p class="inherited"><span class='object_link'><a href="Client.html#client-instance_method" title="WorkOS::Client#client (method)">client</a></span>, <span class='object_link'><a href="Client.html#execute_request-instance_method" title="WorkOS::Client#execute_request (method)">execute_request</a></span>, <span class='object_link'><a href="Client.html#handle_error_response-instance_method" title="WorkOS::Client#handle_error_response (method)">handle_error_response</a></span>, <span class='object_link'><a href="Client.html#post_request-instance_method" title="WorkOS::Client#post_request (method)">post_request</a></span>, <span class='object_link'><a href="Client.html#user_agent-instance_method" title="WorkOS::Client#user_agent (method)">user_agent</a></span></p>
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
180
218
|
|
181
219
|
<div id="class_method_details" class="method_details_list">
|
182
220
|
<h2>Class Method Details</h2>
|
@@ -185,7 +223,7 @@ using the configured SSO Identity Provider.</p>
|
|
185
223
|
<div class="method_details first">
|
186
224
|
<h3 class="signature first" id="authorization_url-class_method">
|
187
225
|
|
188
|
-
.<strong>authorization_url</strong>(
|
226
|
+
.<strong>authorization_url</strong>(project_id:, redirect_uri:, domain: nil, provider: nil, state: {}) ⇒ <tt>String</tt>
|
189
227
|
|
190
228
|
|
191
229
|
|
@@ -194,8 +232,7 @@ using the configured SSO Identity Provider.</p>
|
|
194
232
|
</h3><div class="docstring">
|
195
233
|
<div class="discussion">
|
196
234
|
|
197
|
-
<p>Generate an Oauth2 authorization URL where your users will authenticate
|
198
|
-
using the configured SSO Identity Provider.</p>
|
235
|
+
<p>Generate an Oauth2 authorization URL where your users will authenticate using the configured SSO Identity Provider.</p>
|
199
236
|
|
200
237
|
|
201
238
|
</div>
|
@@ -232,11 +269,30 @@ using the configured SSO Identity Provider.</p>
|
|
232
269
|
<span class='type'>(<tt>String</tt>)</span>
|
233
270
|
|
234
271
|
|
272
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
273
|
+
|
274
|
+
|
275
|
+
—
|
276
|
+
<div class='inline'>
|
277
|
+
<p>The domain for the relevant SSO Connection configured on your WorkOS dashboard. One of provider or domain is required</p>
|
278
|
+
</div>
|
279
|
+
|
280
|
+
</li>
|
281
|
+
|
282
|
+
<li>
|
283
|
+
|
284
|
+
<span class='name'>provider</span>
|
285
|
+
|
286
|
+
|
287
|
+
<span class='type'>(<tt>String</tt>)</span>
|
288
|
+
|
289
|
+
|
290
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
291
|
+
|
235
292
|
|
236
293
|
—
|
237
294
|
<div class='inline'>
|
238
|
-
<p>
|
239
|
-
dashboard</p>
|
295
|
+
<p>A provider name for an Identity Provider configured on your WorkOS dashboard. Only 'Google' is supported.</p>
|
240
296
|
</div>
|
241
297
|
|
242
298
|
</li>
|
@@ -252,8 +308,7 @@ dashboard</p>
|
|
252
308
|
|
253
309
|
—
|
254
310
|
<div class='inline'>
|
255
|
-
<p>The WorkOS project ID for the project where you've
|
256
|
-
connection</p>
|
311
|
+
<p>The WorkOS project ID for the project where you've configured your SSO connection.</p>
|
257
312
|
</div>
|
258
313
|
|
259
314
|
</li>
|
@@ -269,8 +324,7 @@ connection</p>
|
|
269
324
|
|
270
325
|
—
|
271
326
|
<div class='inline'>
|
272
|
-
<p>The URI where users are directed after completing the authentication step.
|
273
|
-
Must match a configured redirect URI on your WorkOS dashboard</p>
|
327
|
+
<p>The URI where users are directed after completing the authentication step. Must match a configured redirect URI on your WorkOS dashboard.</p>
|
274
328
|
</div>
|
275
329
|
|
276
330
|
</li>
|
@@ -283,11 +337,12 @@ Must match a configured redirect URI on your WorkOS dashboard</p>
|
|
283
337
|
<span class='type'>(<tt>Hash</tt>)</span>
|
284
338
|
|
285
339
|
|
340
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
341
|
+
|
286
342
|
|
287
343
|
—
|
288
344
|
<div class='inline'>
|
289
|
-
<p>An aribtrary state object that is preserved and available to the client in
|
290
|
-
the response.</p>
|
345
|
+
<p>An aribtrary state object that is preserved and available to the client in the response.</p>
|
291
346
|
</div>
|
292
347
|
|
293
348
|
</li>
|
@@ -314,29 +369,39 @@ the response.</p>
|
|
314
369
|
<pre class="lines">
|
315
370
|
|
316
371
|
|
317
|
-
55
|
318
|
-
56
|
319
|
-
57
|
320
|
-
58
|
321
|
-
59
|
322
|
-
60
|
323
|
-
61
|
324
372
|
62
|
325
373
|
63
|
326
374
|
64
|
327
|
-
65
|
375
|
+
65
|
376
|
+
66
|
377
|
+
67
|
378
|
+
68
|
379
|
+
69
|
380
|
+
70
|
381
|
+
71
|
382
|
+
72
|
383
|
+
73
|
384
|
+
74
|
385
|
+
75
|
386
|
+
76
|
387
|
+
77</pre>
|
328
388
|
</td>
|
329
389
|
<td>
|
330
|
-
<pre class="code"><span class="info file"># File 'lib/workos/sso.rb', line
|
390
|
+
<pre class="code"><span class="info file"># File 'lib/workos/sso.rb', line 62</span>
|
331
391
|
|
332
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_authorization_url'>authorization_url</span><span class='lparen'>(</span
|
333
|
-
<span class='
|
334
|
-
|
392
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_authorization_url'>authorization_url</span><span class='lparen'>(</span>
|
393
|
+
<span class='label'>project_id:</span><span class='comma'>,</span> <span class='label'>redirect_uri:</span><span class='comma'>,</span> <span class='label'>domain:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>provider:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>state:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
394
|
+
<span class='rparen'>)</span>
|
395
|
+
<span class='id identifier rubyid_validate_domain_and_provider'>validate_domain_and_provider</span><span class='lparen'>(</span><span class='label'>provider:</span> <span class='id identifier rubyid_provider'>provider</span><span class='comma'>,</span> <span class='label'>domain:</span> <span class='id identifier rubyid_domain'>domain</span><span class='rparen'>)</span>
|
396
|
+
|
397
|
+
<span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_encode_www_form'>encode_www_form</span><span class='lparen'>(</span><span class='lbrace'>{</span>
|
335
398
|
<span class='label'>client_id:</span> <span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span>
|
336
399
|
<span class='label'>redirect_uri:</span> <span class='id identifier rubyid_redirect_uri'>redirect_uri</span><span class='comma'>,</span>
|
337
400
|
<span class='label'>response_type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>code</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
338
401
|
<span class='label'>state:</span> <span class='id identifier rubyid_state'>state</span><span class='comma'>,</span>
|
339
|
-
|
402
|
+
<span class='label'>domain:</span> <span class='id identifier rubyid_domain'>domain</span><span class='comma'>,</span>
|
403
|
+
<span class='label'>provider:</span> <span class='id identifier rubyid_provider'>provider</span><span class='comma'>,</span>
|
404
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='rparen'>)</span>
|
340
405
|
|
341
406
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../WorkOS.html" title="WorkOS (module)">WorkOS</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../WorkOS.html#API_HOSTNAME-constant" title="WorkOS::API_HOSTNAME (constant)">API_HOSTNAME</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/sso/authorize?</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_query'>query</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
342
407
|
<span class='kw'>end</span></pre>
|
@@ -348,7 +413,7 @@ the response.</p>
|
|
348
413
|
<div class="method_details ">
|
349
414
|
<h3 class="signature " id="profile-class_method">
|
350
415
|
|
351
|
-
.<strong>profile</strong>(code:, project_id
|
416
|
+
.<strong>profile</strong>(code:, project_id:) ⇒ <tt><span class='object_link'><a href="Profile.html" title="WorkOS::Profile (class)">WorkOS::Profile</a></span></tt>
|
352
417
|
|
353
418
|
|
354
419
|
|
@@ -370,8 +435,7 @@ the response.</p>
|
|
370
435
|
|
371
436
|
<pre class="example code"><code>WorkOS::SSO.profile(
|
372
437
|
code: 'acme.com',
|
373
|
-
project_id: 'project_01DG5TGK363GRVXP3ZS40WNGEZ'
|
374
|
-
redirect_uri: 'https://workos.com/callback',
|
438
|
+
project_id: 'project_01DG5TGK363GRVXP3ZS40WNGEZ'
|
375
439
|
)
|
376
440
|
=> #<WorkOS::Profile:0x00007fb6e4193d20
|
377
441
|
@id="prof_01DRA1XNSJDZ19A31F183ECQW5",
|
@@ -414,25 +478,7 @@ the response.</p>
|
|
414
478
|
|
415
479
|
—
|
416
480
|
<div class='inline'>
|
417
|
-
<p>The WorkOS project ID for the project where you've configured your SSO
|
418
|
-
connection</p>
|
419
|
-
</div>
|
420
|
-
|
421
|
-
</li>
|
422
|
-
|
423
|
-
<li>
|
424
|
-
|
425
|
-
<span class='name'>redirect_uri</span>
|
426
|
-
|
427
|
-
|
428
|
-
<span class='type'>(<tt>String</tt>)</span>
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
—
|
433
|
-
<div class='inline'>
|
434
|
-
<p>The URI where the user was directed after completing the authentication
|
435
|
-
step.</p>
|
481
|
+
<p>The WorkOS project ID for the project where you've configured your SSO connection</p>
|
436
482
|
</div>
|
437
483
|
|
438
484
|
</li>
|
@@ -459,35 +505,33 @@ step.</p>
|
|
459
505
|
<pre class="lines">
|
460
506
|
|
461
507
|
|
462
|
-
100
|
463
|
-
101
|
464
|
-
102
|
465
|
-
103
|
466
|
-
104
|
467
|
-
105
|
468
|
-
106
|
469
|
-
107
|
470
508
|
108
|
471
509
|
109
|
472
510
|
110
|
473
511
|
111
|
474
512
|
112
|
475
|
-
113
|
513
|
+
113
|
514
|
+
114
|
515
|
+
115
|
516
|
+
116
|
517
|
+
117
|
518
|
+
118
|
519
|
+
119
|
520
|
+
120</pre>
|
476
521
|
</td>
|
477
522
|
<td>
|
478
|
-
<pre class="code"><span class="info file"># File 'lib/workos/sso.rb', line
|
523
|
+
<pre class="code"><span class="info file"># File 'lib/workos/sso.rb', line 108</span>
|
479
524
|
|
480
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_profile'>profile</span><span class='lparen'>(</span><span class='label'>code:</span><span class='comma'>,</span> <span class='label'>project_id:</span><span class='
|
525
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_profile'>profile</span><span class='lparen'>(</span><span class='label'>code:</span><span class='comma'>,</span> <span class='label'>project_id:</span><span class='rparen'>)</span>
|
481
526
|
<span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_encode_www_form'>encode_www_form</span><span class='lparen'>(</span>
|
482
527
|
<span class='label'>client_id:</span> <span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span>
|
483
528
|
<span class='label'>client_secret:</span> <span class='const'><span class='object_link'><a href="../WorkOS.html" title="WorkOS (module)">WorkOS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_key!'><span class='object_link'><a href="../WorkOS.html#key!-class_method" title="WorkOS.key! (method)">key!</a></span></span><span class='comma'>,</span>
|
484
|
-
<span class='label'>redirect_uri:</span> <span class='id identifier rubyid_redirect_uri'>redirect_uri</span><span class='comma'>,</span>
|
485
529
|
<span class='label'>grant_type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>authorization_code</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
486
530
|
<span class='label'>code:</span> <span class='id identifier rubyid_code'>code</span><span class='comma'>,</span>
|
487
531
|
<span class='rparen'>)</span>
|
488
532
|
|
489
|
-
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='lparen'>(</span><span class='
|
490
|
-
<span class='id identifier
|
533
|
+
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='lparen'>(</span><span class='id identifier rubyid_post_request'>post_request</span><span class='lparen'>(</span><span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/sso/token?</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_query'>query</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
534
|
+
<span class='id identifier rubyid_check_and_raise_profile_error'>check_and_raise_profile_error</span><span class='lparen'>(</span><span class='label'>response:</span> <span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
|
491
535
|
|
492
536
|
<span class='const'><span class='object_link'><a href="../WorkOS.html" title="WorkOS (module)">WorkOS</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Profile.html" title="WorkOS::Profile (class)">Profile</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Profile.html#initialize-instance_method" title="WorkOS::Profile#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
493
537
|
<span class='kw'>end</span></pre>
|
@@ -501,9 +545,9 @@ step.</p>
|
|
501
545
|
</div>
|
502
546
|
|
503
547
|
<div id="footer">
|
504
|
-
Generated on
|
548
|
+
Generated on Thu Jan 30 09:12:47 2020 by
|
505
549
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
506
|
-
0.9.
|
550
|
+
0.9.22 (ruby-2.6.5).
|
507
551
|
</div>
|
508
552
|
|
509
553
|
</div>
|