strongdm 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. checksums.yaml +4 -4
  2. data/doc/LICENSE.html +45 -136
  3. data/doc/Object.html +300 -105
  4. data/doc/README_md.html +15 -7
  5. data/doc/SDM.html +16 -24
  6. data/doc/SDM/AKS.html +113 -51
  7. data/doc/SDM/AKSBasicAuth.html +93 -35
  8. data/doc/SDM/AKSServiceAccount.html +88 -31
  9. data/doc/SDM/AccountAttachment.html +77 -27
  10. data/doc/SDM/AccountAttachmentCreateOptions.html +62 -13
  11. data/doc/SDM/AccountAttachmentCreateResponse.html +75 -24
  12. data/doc/SDM/AccountAttachmentDeleteResponse.html +69 -19
  13. data/doc/SDM/AccountAttachmentGetResponse.html +75 -23
  14. data/doc/SDM/AccountAttachments.html +42 -39
  15. data/doc/SDM/AccountCreateResponse.html +80 -27
  16. data/doc/SDM/AccountDeleteResponse.html +69 -17
  17. data/doc/SDM/AccountGetResponse.html +74 -21
  18. data/doc/SDM/AccountGrant.html +89 -39
  19. data/doc/SDM/AccountGrantCreateResponse.html +75 -23
  20. data/doc/SDM/AccountGrantDeleteResponse.html +69 -18
  21. data/doc/SDM/AccountGrantGetResponse.html +75 -22
  22. data/doc/SDM/AccountGrants.html +41 -36
  23. data/doc/SDM/AccountUpdateResponse.html +74 -21
  24. data/doc/SDM/Accounts.html +45 -39
  25. data/doc/SDM/AlreadyExistsError.html +13 -10
  26. data/doc/SDM/AmazonEKS.html +108 -47
  27. data/doc/SDM/AmazonES.html +98 -39
  28. data/doc/SDM/Athena.html +98 -39
  29. data/doc/SDM/AuroraMysql.html +103 -43
  30. data/doc/SDM/AuroraPostgres.html +108 -47
  31. data/doc/SDM/AuthenticationError.html +13 -10
  32. data/doc/SDM/BadRequestError.html +13 -10
  33. data/doc/SDM/BigQuery.html +98 -39
  34. data/doc/SDM/Cassandra.html +103 -43
  35. data/doc/SDM/Client.html +29 -48
  36. data/doc/SDM/Clustrix.html +103 -43
  37. data/doc/SDM/Cockroach.html +108 -47
  38. data/doc/SDM/CreateResponseMetadata.html +59 -9
  39. data/doc/SDM/DeadlineExceededError.html +13 -10
  40. data/doc/SDM/DeleteResponseMetadata.html +60 -10
  41. data/doc/SDM/Druid.html +98 -39
  42. data/doc/SDM/DynamoDB.html +98 -39
  43. data/doc/SDM/Elastic.html +103 -43
  44. data/doc/SDM/ElasticacheRedis.html +98 -39
  45. data/doc/SDM/Gateway.html +89 -38
  46. data/doc/SDM/GetResponseMetadata.html +60 -10
  47. data/doc/SDM/GoogleGKE.html +98 -39
  48. data/doc/SDM/Greenplum.html +108 -47
  49. data/doc/SDM/HTTPAuth.html +103 -43
  50. data/doc/SDM/HTTPBasicAuth.html +108 -47
  51. data/doc/SDM/HTTPNoAuth.html +98 -39
  52. data/doc/SDM/InternalError.html +13 -10
  53. data/doc/SDM/Kubernetes.html +113 -51
  54. data/doc/SDM/KubernetesBasicAuth.html +93 -35
  55. data/doc/SDM/KubernetesServiceAccount.html +88 -31
  56. data/doc/SDM/Maria.html +103 -43
  57. data/doc/SDM/Memcached.html +88 -31
  58. data/doc/SDM/Memsql.html +103 -43
  59. data/doc/SDM/MongoHost.html +108 -47
  60. data/doc/SDM/MongoLegacyHost.html +113 -51
  61. data/doc/SDM/MongoLegacyReplicaset.html +118 -55
  62. data/doc/SDM/MongoReplicaSet.html +118 -55
  63. data/doc/SDM/Mysql.html +103 -43
  64. data/doc/SDM/NodeCreateResponse.html +80 -27
  65. data/doc/SDM/NodeDeleteResponse.html +69 -17
  66. data/doc/SDM/NodeGetResponse.html +74 -21
  67. data/doc/SDM/NodeUpdateResponse.html +74 -21
  68. data/doc/SDM/Nodes.html +46 -41
  69. data/doc/SDM/NotFoundError.html +13 -10
  70. data/doc/SDM/Oracle.html +108 -47
  71. data/doc/SDM/PermissionError.html +13 -10
  72. data/doc/SDM/Plumbing.html +375 -371
  73. data/doc/SDM/Postgres.html +108 -47
  74. data/doc/SDM/Presto.html +108 -47
  75. data/doc/SDM/RDP.html +98 -39
  76. data/doc/SDM/RPCError.html +12 -8
  77. data/doc/SDM/RateLimitError.html +13 -10
  78. data/doc/SDM/RateLimitMetadata.html +81 -29
  79. data/doc/SDM/Redis.html +93 -35
  80. data/doc/SDM/Redshift.html +108 -47
  81. data/doc/SDM/Relay.html +77 -26
  82. data/doc/SDM/ResourceCreateResponse.html +74 -21
  83. data/doc/SDM/ResourceDeleteResponse.html +69 -17
  84. data/doc/SDM/ResourceGetResponse.html +74 -21
  85. data/doc/SDM/ResourceUpdateResponse.html +74 -22
  86. data/doc/SDM/Resources.html +43 -35
  87. data/doc/SDM/Role.html +77 -26
  88. data/doc/SDM/RoleAttachment.html +77 -26
  89. data/doc/SDM/RoleAttachmentCreateResponse.html +75 -24
  90. data/doc/SDM/RoleAttachmentDeleteResponse.html +69 -19
  91. data/doc/SDM/RoleAttachmentGetResponse.html +75 -22
  92. data/doc/SDM/RoleAttachments.html +41 -38
  93. data/doc/SDM/RoleCreateResponse.html +75 -23
  94. data/doc/SDM/RoleDeleteResponse.html +69 -17
  95. data/doc/SDM/RoleGetResponse.html +75 -22
  96. data/doc/SDM/RoleGrant.html +77 -24
  97. data/doc/SDM/RoleGrantCreateResponse.html +75 -23
  98. data/doc/SDM/RoleGrantDeleteResponse.html +69 -18
  99. data/doc/SDM/RoleGrantGetResponse.html +75 -22
  100. data/doc/SDM/RoleGrants.html +41 -38
  101. data/doc/SDM/RoleUpdateResponse.html +75 -23
  102. data/doc/SDM/Roles.html +48 -46
  103. data/doc/SDM/SQLServer.html +113 -51
  104. data/doc/SDM/SSH.html +98 -39
  105. data/doc/SDM/Service.html +76 -24
  106. data/doc/SDM/Snowflake.html +103 -43
  107. data/doc/SDM/Sybase.html +98 -39
  108. data/doc/SDM/SybaseIQ.html +98 -39
  109. data/doc/SDM/Teradata.html +98 -39
  110. data/doc/SDM/UpdateResponseMetadata.html +60 -10
  111. data/doc/SDM/User.html +85 -30
  112. data/doc/V1.html +10 -6
  113. data/doc/V1/AccountAttachments.html +10 -6
  114. data/doc/V1/AccountAttachments/Service.html +11 -8
  115. data/doc/V1/AccountGrants.html +10 -6
  116. data/doc/V1/AccountGrants/Service.html +11 -9
  117. data/doc/V1/Accounts.html +10 -6
  118. data/doc/V1/Accounts/Service.html +12 -10
  119. data/doc/V1/Nodes.html +10 -6
  120. data/doc/V1/Nodes/Service.html +13 -13
  121. data/doc/V1/Resources.html +10 -6
  122. data/doc/V1/Resources/Service.html +10 -6
  123. data/doc/V1/RoleAttachments.html +10 -6
  124. data/doc/V1/RoleAttachments/Service.html +11 -11
  125. data/doc/V1/RoleGrants.html +10 -6
  126. data/doc/V1/RoleGrants/Service.html +11 -11
  127. data/doc/V1/Roles.html +10 -6
  128. data/doc/V1/Roles/Service.html +11 -12
  129. data/doc/created.rid +41 -37
  130. data/doc/css/fonts.css +6 -6
  131. data/doc/css/rdoc.css +22 -1
  132. data/doc/examples/Gemfile.html +14 -4
  133. data/doc/examples/Gemfile_lock.html +14 -4
  134. data/doc/examples/README_md.html +14 -4
  135. data/doc/examples/okta-sync/Gemfile.html +105 -0
  136. data/doc/examples/okta-sync/Gemfile_lock.html +146 -0
  137. data/doc/index.html +15 -8
  138. data/doc/js/darkfish.js +23 -100
  139. data/doc/js/navigation.js +4 -41
  140. data/doc/js/navigation.js.gz +0 -0
  141. data/doc/js/search.js +32 -31
  142. data/doc/js/search_index.js +1 -1
  143. data/doc/js/search_index.js.gz +0 -0
  144. data/doc/js/searcher.js +7 -6
  145. data/doc/js/searcher.js.gz +0 -0
  146. data/doc/lib/version.html +16 -6
  147. data/doc/strongdm_gemspec.html +15 -5
  148. data/doc/table_of_contents.html +981 -260
  149. data/examples/Gemfile +2 -2
  150. data/examples/listUsers.rb +8 -8
  151. data/examples/okta-sync/Gemfile +4 -0
  152. data/examples/okta-sync/Gemfile.lock +38 -0
  153. data/examples/okta-sync/matchers.yml +11 -0
  154. data/examples/okta-sync/oktaSync.rb +173 -0
  155. data/examples/panicButton.rb +103 -119
  156. data/lib/errors/errors.rb +55 -53
  157. data/lib/grpc/account_attachments_pb.rb +9 -9
  158. data/lib/grpc/account_attachments_services_pb.rb +7 -8
  159. data/lib/grpc/account_grants_pb.rb +10 -10
  160. data/lib/grpc/account_grants_services_pb.rb +7 -8
  161. data/lib/grpc/accounts_pb.rb +9 -9
  162. data/lib/grpc/accounts_services_pb.rb +7 -8
  163. data/lib/grpc/drivers_pb.rb +7 -7
  164. data/lib/grpc/nodes_pb.rb +9 -9
  165. data/lib/grpc/nodes_services_pb.rb +7 -8
  166. data/lib/grpc/options_pb.rb +5 -5
  167. data/lib/grpc/plumbing.rb +4083 -4084
  168. data/lib/grpc/protoc-gen-swagger/options/annotations_pb.rb +4 -4
  169. data/lib/grpc/resources_pb.rb +9 -9
  170. data/lib/grpc/resources_services_pb.rb +7 -8
  171. data/lib/grpc/role_attachments_pb.rb +9 -9
  172. data/lib/grpc/role_attachments_services_pb.rb +7 -8
  173. data/lib/grpc/role_grants_pb.rb +9 -9
  174. data/lib/grpc/role_grants_services_pb.rb +7 -8
  175. data/lib/grpc/roles_pb.rb +9 -9
  176. data/lib/grpc/roles_services_pb.rb +7 -8
  177. data/lib/grpc/spec_pb.rb +8 -8
  178. data/lib/models/porcelain.rb +4409 -4017
  179. data/lib/strongdm.rb +94 -95
  180. data/lib/svc.rb +1202 -1224
  181. data/lib/version +1 -1
  182. data/lib/version.rb +6 -6
  183. data/strongdm.gemspec +10 -10
  184. metadata +9 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64d39417633f40ee553dcacc106ee8b499ade5c5fa1cda339188d6147aee9414
4
- data.tar.gz: 937450bae4c0b9b10326659f9e137d8cbb5cacf4f8c1dc73037d91792583c79a
3
+ metadata.gz: e52f4868813476da740349095c7e130ef595894f3174b9a1ec26a0b9d9e8c515
4
+ data.tar.gz: 8d6550036b3bcb59dfe84d304da375bd91d34808e92f6d53918e24d709db19ca
5
5
  SHA512:
6
- metadata.gz: efe4d90c9f811992211ecc4bbba76c5795c1d6a36ff3f4dafbb4f40a528b721545a746c7383636ec8cbefa6d6fd04c49d4806648e974b4cb00fb6a645c651625
7
- data.tar.gz: 382676d3c3d79e727995af8f023d2c87e0e05adadea025650dc63007a80e93d33c9a4b96e1d5a5798b0f6a475c50c5ccf76fdcf0d58a6e83e99b66c966cdedf5
6
+ metadata.gz: 67aa4c5a0f3a6ca8c21a3fbe8aba455ca171866f2d4bb4dd26c93f4bc2f2392b484f49ae4fcfe640b455fac2bd384526ecf159c001625be2482245d9fc3918d1
7
+ data.tar.gz: b34b1e5c819bf50092aebcc7f8736fc4402be787a71bae244988544facbd3fd8331241f27c12c7774b86421ef8976d9476e6eda85e1056095efd4603d1df062a
data/doc/LICENSE.html CHANGED
@@ -8,16 +8,21 @@
8
8
 
9
9
  <script type="text/javascript">
10
10
  var rdoc_rel_prefix = "./";
11
+ var index_rel_prefix = "./";
11
12
  </script>
12
13
 
13
- <script src="./js/jquery.js"></script>
14
- <script src="./js/darkfish.js"></script>
14
+ <script src="./js/navigation.js" defer></script>
15
+ <script src="./js/search.js" defer></script>
16
+ <script src="./js/search_index.js" defer></script>
17
+ <script src="./js/searcher.js" defer></script>
18
+ <script src="./js/darkfish.js" defer></script>
15
19
 
16
20
  <link href="./css/fonts.css" rel="stylesheet">
17
21
  <link href="./css/rdoc.css" rel="stylesheet">
18
22
 
19
23
 
20
24
 
25
+
21
26
  <body id="top" role="document" class="file">
22
27
  <nav role="navigation">
23
28
  <div id="project-navigation">
@@ -68,6 +73,10 @@
68
73
 
69
74
  <li><a href="./examples/README_md.html">README</a>
70
75
 
76
+ <li><a href="./examples/okta-sync/Gemfile.html">Gemfile</a>
77
+
78
+ <li><a href="./examples/okta-sync/Gemfile_lock.html">Gemfile.lock</a>
79
+
71
80
  <li><a href="./lib/version.html">version</a>
72
81
 
73
82
  <li><a href="./strongdm_gemspec.html">strongdm.gemspec</a>
@@ -88,88 +97,31 @@ http://www.apache.org/licenses/</pre>
88
97
  <ol><li>
89
98
  <p>Definitions.</p>
90
99
 
91
- <p>“License” shall mean the terms and conditions for use, reproduction, and
92
- distribution as defined by Sections 1 through 9 of this document.</p>
93
-
94
- <p>“Licensor” shall mean the copyright owner or entity authorized by the
95
- copyright owner that is granting the License.</p>
96
-
97
- <p>“Legal Entity” shall mean the union of the acting entity and all other
98
- entities that control, are controlled by, or are under common control with
99
- that entity. For the purposes of this definition, “control” means (i) the
100
- power, direct or indirect, to cause the direction or management of such
101
- entity, whether by contract or otherwise, or (ii) ownership of fifty
102
- percent (50%) or more of the outstanding shares, or (iii) beneficial
103
- ownership of such entity.</p>
104
-
105
- <p>“You” (or “Your”) shall mean an individual or Legal Entity exercising
106
- permissions granted by this License.</p>
107
-
108
- <p>“Source” form shall mean the preferred form for making modifications,
109
- including but not limited to software source code, documentation source,
110
- and configuration files.</p>
111
-
112
- <p>“Object” form shall mean any form resulting from mechanical transformation
113
- or translation of a Source form, including but not limited to compiled
114
- object code, generated documentation, and conversions to other media types.</p>
115
-
116
- <p>“Work” shall mean the work of authorship, whether in Source or <a
117
- href="Object.html">Object</a> form, made available under the License, as
118
- indicated by a copyright notice that is included in or attached to the work
119
- (an example is provided in the Appendix below).</p>
120
-
121
- <p>“Derivative Works” shall mean any work, whether in Source or <a
122
- href="Object.html">Object</a> form, that is based on (or derived from) the
123
- Work and for which the editorial revisions, annotations, elaborations, or
124
- other modifications represent, as a whole, an original work of authorship.
125
- For the purposes of this License, Derivative Works shall not include works
126
- that remain separable from, or merely link (or bind by name) to the
127
- interfaces of, the Work and Derivative Works thereof.</p>
128
-
129
- <p>“Contribution” shall mean any work of authorship, including the original
130
- version of the Work and any modifications or additions to that Work or
131
- Derivative Works thereof, that is intentionally submitted to Licensor for
132
- inclusion in the Work by the copyright owner or by an individual or Legal
133
- Entity authorized to submit on behalf of the copyright owner. For the
134
- purposes of this definition, “submitted” means any form of electronic,
135
- verbal, or written communication sent to the Licensor or its
136
- representatives, including but not limited to communication on electronic
137
- mailing lists, source code control systems, and issue tracking systems that
138
- are managed by, or on behalf of, the Licensor for the purpose of discussing
139
- and improving the Work, but excluding communication that is conspicuously
140
- marked or otherwise designated in writing by the copyright owner as “Not a
141
- Contribution.”</p>
142
-
143
- <p>“Contributor” shall mean Licensor and any individual or Legal Entity on
144
- behalf of whom a Contribution has been received by Licensor and
145
- subsequently incorporated within the Work.</p>
100
+ <p>“License” shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.</p>
101
+
102
+ <p>“Licensor” shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.</p>
103
+
104
+ <p>“Legal Entity” shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, “control” means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.</p>
105
+
106
+ <p>“You” (or “Your) shall mean an individual or Legal Entity exercising permissions granted by this License.</p>
107
+
108
+ <p>“Source” form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.</p>
109
+
110
+ <p>“Object” form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.</p>
111
+
112
+ <p>“Work” shall mean the work of authorship, whether in Source or <a href="Object.html"><code>Object</code></a> form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).</p>
113
+
114
+ <p>“Derivative Worksshall mean any work, whether in Source or <a href="Object.html"><code>Object</code></a> form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.</p>
115
+
116
+ <p>“Contribution” shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, “submitted” means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as “Not a Contribution.”</p>
117
+
118
+ <p>“Contributor” shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.</p>
146
119
  </li><li>
147
- <p>Grant of Copyright License. Subject to the terms and conditions of this
148
- License, each Contributor hereby grants to You a perpetual, worldwide,
149
- non-exclusive, no-charge, royalty-free, irrevocable copyright license to
150
- reproduce, prepare Derivative Works of, publicly display, publicly perform,
151
- sublicense, and distribute the Work and such Derivative Works in Source or
152
- <a href="Object.html">Object</a> form.</p>
120
+ <p>Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or <a href="Object.html"><code>Object</code></a> form.</p>
153
121
  </li><li>
154
- <p>Grant of Patent License. Subject to the terms and conditions of this
155
- License, each Contributor hereby grants to You a perpetual, worldwide,
156
- non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
157
- this section) patent license to make, have made, use, offer to sell, sell,
158
- import, and otherwise transfer the Work, where such license applies only to
159
- those patent claims licensable by such Contributor that are necessarily
160
- infringed by their Contribution(s) alone or by combination of their
161
- Contribution(s) with the Work to which such Contribution(s) was submitted.
162
- If You institute patent litigation against any entity (including a
163
- cross-claim or counterclaim in a lawsuit) alleging that the Work or a
164
- Contribution incorporated within the Work constitutes direct or
165
- contributory patent infringement, then any patent licenses granted to You
166
- under this License for that Work shall terminate as of the date such
167
- litigation is filed.</p>
122
+ <p>Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.</p>
168
123
  </li><li>
169
- <p>Redistribution. You may reproduce and distribute copies of the Work or
170
- Derivative Works thereof in any medium, with or without modifications, and
171
- in Source or <a href="Object.html">Object</a> form, provided that You meet
172
- the following conditions:</p>
124
+ <p>Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or <a href="Object.html"><code>Object</code></a> form, provided that You meet the following conditions:</p>
173
125
 
174
126
  <p>(a) You must give any other recipients of the Work or</p>
175
127
 
@@ -204,55 +156,17 @@ or as an addendum to the NOTICE text from the Work, provided
204
156
  that such additional attribution notices cannot be construed
205
157
  as modifying the License.</pre>
206
158
 
207
- <p>You may add Your own copyright statement to Your modifications and may
208
- provide additional or different license terms and conditions for use,
209
- reproduction, or distribution of Your modifications, or for any such
210
- Derivative Works as a whole, provided Your use, reproduction, and
211
- distribution of the Work otherwise complies with the conditions stated in
212
- this License.</p>
159
+ <p>You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.</p>
213
160
  </li><li>
214
- <p>Submission of Contributions. Unless You explicitly state otherwise, any
215
- Contribution intentionally submitted for inclusion in the Work by You to
216
- the Licensor shall be under the terms and conditions of this License,
217
- without any additional terms or conditions. Notwithstanding the above,
218
- nothing herein shall supersede or modify the terms of any separate license
219
- agreement you may have executed with Licensor regarding such Contributions.</p>
161
+ <p>Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.</p>
220
162
  </li><li>
221
- <p>Trademarks. This License does not grant permission to use the trade names,
222
- trademarks, service marks, or product names of the Licensor, except as
223
- required for reasonable and customary use in describing the origin of the
224
- Work and reproducing the content of the NOTICE file.</p>
163
+ <p>Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.</p>
225
164
  </li><li>
226
- <p>Disclaimer of Warranty. Unless required by applicable law or agreed to in
227
- writing, Licensor provides the Work (and each Contributor provides its
228
- Contributions) on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
229
- KIND, either express or implied, including, without limitation, any
230
- warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or
231
- FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for
232
- determining the appropriateness of using or redistributing the Work and
233
- assume any risks associated with Your exercise of permissions under this
234
- License.</p>
165
+ <p>Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.</p>
235
166
  </li><li>
236
- <p>Limitation of Liability. In no event and under no legal theory, whether in
237
- tort (including negligence), contract, or otherwise, unless required by
238
- applicable law (such as deliberate and grossly negligent acts) or agreed to
239
- in writing, shall any Contributor be liable to You for damages, including
240
- any direct, indirect, special, incidental, or consequential damages of any
241
- character arising as a result of this License or out of the use or
242
- inability to use the Work (including but not limited to damages for loss of
243
- goodwill, work stoppage, computer failure or malfunction, or any and all
244
- other commercial damages or losses), even if such Contributor has been
245
- advised of the possibility of such damages.</p>
167
+ <p>Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.</p>
246
168
  </li><li>
247
- <p>Accepting Warranty or Additional Liability. While redistributing the Work
248
- or Derivative Works thereof, You may choose to offer, and charge a fee for,
249
- acceptance of support, warranty, indemnity, or other liability obligations
250
- and/or rights consistent with this License. However, in accepting such
251
- obligations, You may act only on Your own behalf and on Your sole
252
- responsibility, not on behalf of any other Contributor, and only if You
253
- agree to indemnify, defend, and hold each Contributor harmless for any
254
- liability incurred by, or claims asserted against, such Contributor by
255
- reason of your accepting any such warranty or additional liability.</p>
169
+ <p>Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.</p>
256
170
  </li></ol>
257
171
 
258
172
  <p>END OF TERMS AND CONDITIONS</p>
@@ -270,25 +184,20 @@ identification within third-party archives.</pre>
270
184
 
271
185
  <p>Copyright 2020 StrongDM Inc</p>
272
186
 
273
- <p>Licensed under the Apache License, Version 2.0 (the “License”); you may not
274
- use this file except in compliance with the License. You may obtain a copy
275
- of the License at</p>
187
+ <p>Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at</p>
276
188
 
277
- <pre class="ruby"><span class="ruby-identifier">http</span>:<span class="ruby-operator">/</span><span class="ruby-regexp">/www.apache.org/</span><span class="ruby-identifier">licenses</span><span class="ruby-operator">/</span><span class="ruby-constant">LICENSE</span><span class="ruby-operator">-</span><span class="ruby-value">2.0</span>
189
+ <pre class="ruby"><span class="ruby-identifier">http</span><span class="ruby-value">:/</span><span class="ruby-operator">/</span><span class="ruby-identifier">www</span>.<span class="ruby-identifier">apache</span>.<span class="ruby-identifier">org</span><span class="ruby-operator">/</span><span class="ruby-identifier">licenses</span><span class="ruby-operator">/</span><span class="ruby-constant">LICENSE</span><span class="ruby-value">-2.0</span>
278
190
  </pre>
279
191
 
280
- <p>Unless required by applicable law or agreed to in writing, software
281
- distributed under the License is distributed on an “AS IS” BASIS, WITHOUT
282
- WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
283
- License for the specific language governing permissions and limitations
284
- under the License.</p>
192
+ <p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</p>
193
+
285
194
  </main>
286
195
 
287
196
 
288
197
 
289
198
  <footer id="validator-badges" role="contentinfo">
290
- <p><a href="http://validator.w3.org/check/referer">Validate</a>
291
- <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
199
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
200
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.2.
292
201
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
293
202
  </footer>
294
203
 
data/doc/Object.html CHANGED
@@ -8,16 +8,21 @@
8
8
 
9
9
  <script type="text/javascript">
10
10
  var rdoc_rel_prefix = "./";
11
+ var index_rel_prefix = "./";
11
12
  </script>
12
13
 
13
- <script src="./js/jquery.js"></script>
14
- <script src="./js/darkfish.js"></script>
14
+ <script src="./js/navigation.js" defer></script>
15
+ <script src="./js/search.js" defer></script>
16
+ <script src="./js/search_index.js" defer></script>
17
+ <script src="./js/searcher.js" defer></script>
18
+ <script src="./js/darkfish.js" defer></script>
15
19
 
16
20
  <link href="./css/fonts.css" rel="stylesheet">
17
21
  <link href="./css/rdoc.css" rel="stylesheet">
18
22
 
19
23
 
20
24
 
25
+
21
26
  <body id="top" role="document" class="class">
22
27
  <nav role="navigation">
23
28
  <div id="project-navigation">
@@ -72,6 +77,8 @@
72
77
 
73
78
  <li ><a href="#method-i-main">#main</a>
74
79
 
80
+ <li ><a href="#method-i-okta_sync">#okta_sync</a>
81
+
75
82
  </ul>
76
83
  </div>
77
84
 
@@ -88,8 +95,6 @@
88
95
  </section>
89
96
 
90
97
 
91
-
92
-
93
98
  <section id="5Buntitled-5D" class="documentation-section">
94
99
 
95
100
 
@@ -117,6 +122,26 @@
117
122
  <dd>
118
123
 
119
124
 
125
+ <dt id="OKTA_CLIENT_ORGURL">OKTA_CLIENT_ORGURL
126
+
127
+ <dd>
128
+
129
+
130
+ <dt id="OKTA_CLIENT_TOKEN">OKTA_CLIENT_TOKEN
131
+
132
+ <dd>
133
+
134
+
135
+ <dt id="SDM_API_ACCESS_KEY">SDM_API_ACCESS_KEY
136
+
137
+ <dd>
138
+
139
+
140
+ <dt id="SDM_API_SECRET_KEY">SDM_API_SECRET_KEY
141
+
142
+ <dd>
143
+
144
+
120
145
  </dl>
121
146
  </section>
122
147
 
@@ -143,128 +168,297 @@
143
168
 
144
169
  <div class="method-description">
145
170
 
146
- <p>panicButton.rb suspends all users except for one admin, in the fake use
147
- case of a critical break in or something usage: ruby panicButton.rb
148
- adminuser@email.com to revert back to pre-panic state: ruby panicButton.rb
149
- revert</p>
171
+ <p>panicButton.rb suspends all users except for one admin, in the fake use case of a critical break in or something usage: ruby panicButton.rb adminuser@email.com to revert back to pre-panic state: ruby panicButton.rb revert</p>
150
172
 
151
173
 
152
174
 
153
175
 
154
176
  <div class="method-source-code" id="main-source">
155
- <pre><span class="ruby-comment"># File examples/panicButton.rb, line 40</span>
156
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">main</span>
157
- <span class="ruby-identifier">access_key</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;SDM_API_ACCESS_KEY&quot;</span>]
158
- <span class="ruby-identifier">secret_key</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;SDM_API_SECRET_KEY&quot;</span>]
159
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">access_key</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">secret_key</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
160
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;SDM_API_ACCESS_KEY and SDM_API_SECRET_KEY must be provided&quot;</span>
161
- <span class="ruby-keyword">return</span>
162
- <span class="ruby-keyword">end</span>
163
- <span class="ruby-identifier">client</span> = <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">access_key</span>, <span class="ruby-identifier">secret_key</span>)
164
-
165
- <span class="ruby-keyword">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-keyword">and</span> <span class="ruby-constant">ARGV</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-string">&quot;revert&quot;</span>
166
- <span class="ruby-identifier">state_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">&quot;state.json&quot;</span>)
167
- <span class="ruby-identifier">state</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">state_file</span>)
168
-
169
- <span class="ruby-identifier">reinstated_count</span> = <span class="ruby-value">0</span>
177
+ <pre><span class="ruby-comment"># File examples/panicButton.rb, line 25</span>
178
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">main</span>
179
+ <span class="ruby-identifier">access_key</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;SDM_API_ACCESS_KEY&quot;</span>]
180
+ <span class="ruby-identifier">secret_key</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;SDM_API_SECRET_KEY&quot;</span>]
181
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">access_key</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">secret_key</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
182
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;SDM_API_ACCESS_KEY and SDM_API_SECRET_KEY must be provided&quot;</span>
183
+ <span class="ruby-keyword">return</span>
184
+ <span class="ruby-keyword">end</span>
185
+ <span class="ruby-identifier">client</span> = <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">access_key</span>, <span class="ruby-identifier">secret_key</span>)
186
+
187
+ <span class="ruby-keyword">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-keyword">and</span> <span class="ruby-constant">ARGV</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-string">&quot;revert&quot;</span>
188
+ <span class="ruby-identifier">state_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">&quot;state.json&quot;</span>)
189
+ <span class="ruby-identifier">state</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">state_file</span>)
190
+
191
+ <span class="ruby-identifier">reinstated_count</span> = <span class="ruby-value">0</span>
192
+
193
+ <span class="ruby-identifier">users</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">list</span>(<span class="ruby-string">&quot;&quot;</span>)
194
+ <span class="ruby-identifier">users</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">user</span><span class="ruby-operator">|</span>
195
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">suspended</span>
196
+ <span class="ruby-identifier">reinstated_count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
197
+ <span class="ruby-identifier">user</span>.<span class="ruby-identifier">suspended</span> = <span class="ruby-keyword">false</span>
198
+ <span class="ruby-identifier">client</span>.<span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">user</span>)
199
+ <span class="ruby-keyword">end</span>
200
+ }
201
+ <span class="ruby-identifier">state</span>[<span class="ruby-string">&quot;attachments&quot;</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">attachment</span><span class="ruby-operator">|</span>
202
+ <span class="ruby-keyword">begin</span>
203
+ <span class="ruby-identifier">a</span> = <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">AccountAttachment</span>.<span class="ruby-identifier">new</span>()
204
+ <span class="ruby-identifier">a</span>.<span class="ruby-identifier">account_id</span> = <span class="ruby-identifier">attachment</span>[<span class="ruby-string">&quot;account_id&quot;</span>]
205
+ <span class="ruby-identifier">a</span>.<span class="ruby-identifier">role_id</span> = <span class="ruby-identifier">attachment</span>[<span class="ruby-string">&quot;role_id&quot;</span>]
206
+ <span class="ruby-identifier">client</span>.<span class="ruby-identifier">account_attachments</span>.<span class="ruby-identifier">create</span>(<span class="ruby-identifier">a</span>)
207
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">AlreadyExistsError</span>
208
+ <span class="ruby-keyword">rescue</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">ex</span>
209
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;skipping creation of attachment due to error: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">to_s</span>
210
+ <span class="ruby-keyword">end</span>
211
+ }
212
+ <span class="ruby-identifier">state</span>[<span class="ruby-string">&quot;grants&quot;</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">attachment</span><span class="ruby-operator">|</span>
213
+ <span class="ruby-keyword">begin</span>
214
+ <span class="ruby-identifier">g</span> = <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">AccountGrant</span>.<span class="ruby-identifier">new</span>()
215
+ <span class="ruby-identifier">g</span>.<span class="ruby-identifier">account_id</span> = <span class="ruby-identifier">attachment</span>[<span class="ruby-string">&quot;account_id&quot;</span>]
216
+ <span class="ruby-identifier">g</span>.<span class="ruby-identifier">resource_id</span> = <span class="ruby-identifier">attachment</span>[<span class="ruby-string">&quot;resource_id&quot;</span>]
217
+ <span class="ruby-identifier">client</span>.<span class="ruby-identifier">account_grants</span>.<span class="ruby-identifier">create</span>(<span class="ruby-identifier">g</span>)
218
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">AlreadyExistsError</span>
219
+ <span class="ruby-keyword">rescue</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">ex</span>
220
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;skipping creation of grant due to error: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">to_s</span>
221
+ <span class="ruby-keyword">end</span>
222
+ }
170
223
 
171
- <span class="ruby-identifier">users</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">list</span>(<span class="ruby-string">&#39;&#39;</span>)
172
- <span class="ruby-identifier">users</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">user</span><span class="ruby-operator">|</span>
173
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">suspended</span>
174
- <span class="ruby-identifier">reinstated_count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
175
- <span class="ruby-identifier">user</span>.<span class="ruby-identifier">suspended</span> = <span class="ruby-keyword">false</span>
176
- <span class="ruby-identifier">client</span>.<span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">user</span>)
177
- <span class="ruby-keyword">end</span>
178
- }
179
- <span class="ruby-identifier">state</span>[<span class="ruby-string">&quot;attachments&quot;</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">attachment</span><span class="ruby-operator">|</span>
180
- <span class="ruby-keyword">begin</span>
181
- <span class="ruby-identifier">a</span> = <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">AccountAttachment</span>.<span class="ruby-identifier">new</span>()
182
- <span class="ruby-identifier">a</span>.<span class="ruby-identifier">account_id</span> = <span class="ruby-identifier">attachment</span>[<span class="ruby-string">&quot;account_id&quot;</span>]
183
- <span class="ruby-identifier">a</span>.<span class="ruby-identifier">role_id</span> = <span class="ruby-identifier">attachment</span>[<span class="ruby-string">&quot;role_id&quot;</span>]
184
- <span class="ruby-identifier">client</span>.<span class="ruby-identifier">account_attachments</span>.<span class="ruby-identifier">create</span>(<span class="ruby-identifier">a</span>)
185
- <span class="ruby-keyword">rescue</span> <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">AlreadyExistsError</span>
186
- <span class="ruby-keyword">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ex</span>
187
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;skipping creation of attachment due to error: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">to_s</span>
188
- <span class="ruby-keyword">end</span>
224
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;reinstated &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">reinstated_count</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; users&quot;</span>
225
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;recreated &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">state</span>[<span class="ruby-string">&quot;attachments&quot;</span>].<span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; account attachments&quot;</span>
226
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;recreated &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">state</span>[<span class="ruby-string">&quot;grants&quot;</span>].<span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; account grants&quot;</span>
227
+
228
+ <span class="ruby-keyword">return</span>
229
+ <span class="ruby-keyword">end</span>
230
+
231
+ <span class="ruby-identifier">admin_email</span> = <span class="ruby-string">&quot;&quot;</span>
232
+ <span class="ruby-keyword">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
233
+ <span class="ruby-identifier">admin_email</span> = <span class="ruby-constant">ARGV</span>[<span class="ruby-value">0</span>]
234
+ <span class="ruby-keyword">else</span>
235
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;please provide an admin email to preserve&quot;</span>
236
+ <span class="ruby-keyword">return</span> <span class="ruby-value">1</span>
237
+ <span class="ruby-keyword">end</span>
238
+
239
+ <span class="ruby-identifier">admin_user_id</span> = <span class="ruby-string">&quot;&quot;</span>
240
+ <span class="ruby-identifier">users</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">list</span>(<span class="ruby-string">&quot;email:?&quot;</span>, <span class="ruby-identifier">admin_email</span>)
241
+ <span class="ruby-identifier">users</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">user</span><span class="ruby-operator">|</span>
242
+ <span class="ruby-identifier">admin_user_id</span> = <span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>
243
+ }
244
+
245
+ <span class="ruby-identifier">account_attachments</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">account_attachments</span>.<span class="ruby-identifier">list</span>(<span class="ruby-string">&quot;&quot;</span>)
246
+ <span class="ruby-identifier">account_grants</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">account_grants</span>.<span class="ruby-identifier">list</span>(<span class="ruby-string">&quot;&quot;</span>)
247
+
248
+ <span class="ruby-identifier">state</span> = {
249
+ <span class="ruby-value">&#39;attachments&#39;:</span> <span class="ruby-identifier">account_attachments</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
250
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">account_id</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">admin_user_id</span>
251
+ <span class="ruby-identifier">out</span> = {
252
+ <span class="ruby-value">&#39;account_id&#39;:</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">account_id</span>,
253
+ <span class="ruby-value">&#39;role_id&#39;:</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">role_id</span>,
189
254
  }
190
- <span class="ruby-identifier">state</span>[<span class="ruby-string">&quot;grants&quot;</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">attachment</span><span class="ruby-operator">|</span>
191
- <span class="ruby-keyword">begin</span>
192
- <span class="ruby-identifier">g</span> = <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">AccountGrant</span>.<span class="ruby-identifier">new</span>()
193
- <span class="ruby-identifier">g</span>.<span class="ruby-identifier">account_id</span> = <span class="ruby-identifier">attachment</span>[<span class="ruby-string">&quot;account_id&quot;</span>]
194
- <span class="ruby-identifier">g</span>.<span class="ruby-identifier">resource_id</span> = <span class="ruby-identifier">attachment</span>[<span class="ruby-string">&quot;resource_id&quot;</span>]
195
- <span class="ruby-identifier">client</span>.<span class="ruby-identifier">account_grants</span>.<span class="ruby-identifier">create</span>(<span class="ruby-identifier">g</span>)
196
- <span class="ruby-keyword">rescue</span> <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">AlreadyExistsError</span>
197
- <span class="ruby-keyword">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ex</span>
198
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;skipping creation of grant due to error: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">to_s</span>
199
- <span class="ruby-keyword">end</span>
255
+ <span class="ruby-keyword">end</span>
256
+ }.<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> },
257
+ <span class="ruby-value">&#39;grants&#39;:</span> <span class="ruby-identifier">account_grants</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
258
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">account_id</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">admin_user_id</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">valid_until</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
259
+ <span class="ruby-identifier">out</span> = {
260
+ <span class="ruby-value">&#39;account_id&#39;:</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">account_id</span>,
261
+ <span class="ruby-value">&#39;resource_id&#39;:</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">resource_id</span>,
200
262
  }
263
+ <span class="ruby-keyword">end</span>
264
+ }.<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> },
265
+ }
201
266
 
202
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;reinstated &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">reinstated_count</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; users&quot;</span>
203
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;recreated &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">state</span>[<span class="ruby-string">&quot;attachments&quot;</span>].<span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; account attachments&quot;</span>
204
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;recreated &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">state</span>[<span class="ruby-string">&quot;grants&quot;</span>].<span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; account grants&quot;</span>
267
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;storing &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">state</span>[<span class="ruby-value">:attachments</span>].<span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; account attachments in state&quot;</span>
268
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;storing &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">state</span>[<span class="ruby-value">:grants</span>].<span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; account grants in state&quot;</span>
205
269
 
206
- <span class="ruby-keyword">return</span>
207
- <span class="ruby-keyword">end</span>
270
+ <span class="ruby-identifier">state_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">&quot;state.json&quot;</span>, <span class="ruby-string">&quot;w&quot;</span>)
271
+ <span class="ruby-identifier">state_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">state</span>.<span class="ruby-identifier">to_json</span>)
208
272
 
209
- <span class="ruby-identifier">admin_email</span> = <span class="ruby-string">&quot;&quot;</span>
210
- <span class="ruby-keyword">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
211
- <span class="ruby-identifier">admin_email</span> = <span class="ruby-constant">ARGV</span>[<span class="ruby-value">0</span>]
212
- <span class="ruby-keyword">else</span>
213
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;please provide an admin email to preserve&quot;</span>
214
- <span class="ruby-keyword">return</span> <span class="ruby-value">1</span>
273
+ <span class="ruby-identifier">suspended_count</span> = <span class="ruby-value">0</span>
274
+ <span class="ruby-identifier">users</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">list</span>(<span class="ruby-string">&quot;&quot;</span>)
275
+ <span class="ruby-identifier">users</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">user</span><span class="ruby-operator">|</span>
276
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">instance_of?</span> <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">User</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">email</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">admin_email</span>
277
+ <span class="ruby-keyword">next</span>
215
278
  <span class="ruby-keyword">end</span>
279
+ <span class="ruby-identifier">user</span>.<span class="ruby-identifier">suspended</span> = <span class="ruby-keyword">true</span>
280
+ <span class="ruby-keyword">begin</span>
281
+ <span class="ruby-identifier">client</span>.<span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">user</span>)
282
+ <span class="ruby-identifier">suspended_count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
283
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">StandardError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">ex</span>
284
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;skipping user &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; on account of error: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">to_s</span>
285
+ <span class="ruby-keyword">end</span>
286
+ }
216
287
 
217
- <span class="ruby-identifier">admin_user_id</span> = <span class="ruby-string">&quot;&quot;</span>
218
- <span class="ruby-identifier">users</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">list</span>(<span class="ruby-string">&quot;email:?&quot;</span>, <span class="ruby-identifier">admin_email</span>)
219
- <span class="ruby-identifier">users</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">user</span><span class="ruby-operator">|</span>
220
- <span class="ruby-identifier">admin_user_id</span> = <span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>
221
- }
288
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;suspended &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">suspended_count</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; users&quot;</span>
289
+ <span class="ruby-keyword">end</span></pre>
290
+ </div>
291
+
292
+ </div>
222
293
 
223
- <span class="ruby-identifier">account_attachments</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">account_attachments</span>.<span class="ruby-identifier">list</span>(<span class="ruby-string">&#39;&#39;</span>)
224
- <span class="ruby-identifier">account_grants</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">account_grants</span>.<span class="ruby-identifier">list</span>(<span class="ruby-string">&#39;&#39;</span>)
294
+
225
295
 
226
- <span class="ruby-identifier">state</span> = {
227
- <span class="ruby-string">&#39;attachments&#39;</span><span class="ruby-operator">:</span> <span class="ruby-identifier">account_attachments</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
228
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">account_id</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">admin_user_id</span>
229
- <span class="ruby-identifier">out</span> = {
230
- <span class="ruby-string">&#39;account_id&#39;</span><span class="ruby-operator">:</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">account_id</span>,
231
- <span class="ruby-string">&#39;role_id&#39;</span><span class="ruby-operator">:</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">role_id</span>,
232
- }
233
- <span class="ruby-keyword">end</span>
234
- }.<span class="ruby-identifier">reject</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>},
235
- <span class="ruby-string">&#39;grants&#39;</span><span class="ruby-operator">:</span> <span class="ruby-identifier">account_grants</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
236
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">account_id</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">admin_user_id</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">valid_until</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
237
- <span class="ruby-identifier">out</span> = {
238
- <span class="ruby-string">&#39;account_id&#39;</span><span class="ruby-operator">:</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">account_id</span>,
239
- <span class="ruby-string">&#39;resource_id&#39;</span><span class="ruby-operator">:</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">resource_id</span>,
240
- }
241
- <span class="ruby-keyword">end</span>
242
- }.<span class="ruby-identifier">reject</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>},
243
- }
296
+
297
+ </div>
244
298
 
245
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;storing &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">state</span>[<span class="ruby-value">:attachments</span>].<span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; account attachments in state&quot;</span>
246
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;storing &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">state</span>[<span class="ruby-value">:grants</span>].<span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; account grants in state&quot;</span>
299
+
300
+ <div id="method-i-okta_sync" class="method-detail ">
301
+
302
+ <div class="method-heading">
303
+ <span class="method-name">okta_sync</span><span
304
+ class="method-args">()</span>
305
+
306
+ <span class="method-click-advice">click to toggle source</span>
307
+
308
+ </div>
309
+
247
310
 
248
- <span class="ruby-identifier">state_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">&quot;state.json&quot;</span>, <span class="ruby-string">&quot;w&quot;</span>)
249
- <span class="ruby-identifier">state_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">state</span>.<span class="ruby-identifier">to_json</span>)
311
+ <div class="method-description">
312
+
313
+
314
+
315
+
250
316
 
251
- <span class="ruby-identifier">suspended_count</span> = <span class="ruby-value">0</span>
252
- <span class="ruby-identifier">users</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">list</span>(<span class="ruby-string">&#39;&#39;</span>)
253
- <span class="ruby-identifier">users</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">user</span><span class="ruby-operator">|</span>
254
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">instance_of?</span> <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">User</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">email</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">admin_email</span>
255
- <span class="ruby-keyword">next</span>
317
+
318
+ <div class="method-source-code" id="okta_sync-source">
319
+ <pre><span class="ruby-comment"># File examples/okta-sync/oktaSync.rb, line 25</span>
320
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">okta_sync</span>
321
+ <span class="ruby-keyword">if</span> <span class="ruby-constant">SDM_API_ACCESS_KEY</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-constant">SDM_API_SECRET_KEY</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-constant">OKTA_CLIENT_TOKEN</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-constant">OKTA_CLIENT_ORGURL</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;&quot;</span>
322
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;SDM_API_ACCESS_KEY, SDM_API_SECRET_KEY, OKTA_CLIENT_TOKEN, and OKTA_CLIENT_ORGURL must be set&quot;</span>
323
+ <span class="ruby-identifier">exit</span>
324
+ <span class="ruby-keyword">end</span>
325
+
326
+ <span class="ruby-identifier">report</span> = {
327
+ <span class="ruby-value">:start</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>,
328
+
329
+ <span class="ruby-value">:oktaUsersCount</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-value">0</span>,
330
+ <span class="ruby-value">:oktaUsers</span> <span class="ruby-operator">=&gt;</span> [],
331
+
332
+ <span class="ruby-value">:sdmUsersCount</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-value">0</span>,
333
+ <span class="ruby-value">:sdmUsers</span> <span class="ruby-operator">=&gt;</span> [],
334
+
335
+ <span class="ruby-value">:bothUsersCount</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-value">0</span>,
336
+
337
+ <span class="ruby-value">:sdmResourcesCount</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-value">0</span>,
338
+ <span class="ruby-value">:sdmResources</span> <span class="ruby-operator">=&gt;</span> {},
339
+
340
+ <span class="ruby-value">:permissionsGranted</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-value">0</span>,
341
+ <span class="ruby-value">:permissionsRevoked</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-value">0</span>,
342
+ <span class="ruby-value">:grants</span> <span class="ruby-operator">=&gt;</span> [],
343
+ <span class="ruby-value">:revocations</span> <span class="ruby-operator">=&gt;</span> [],
344
+
345
+ <span class="ruby-value">:matchers</span> <span class="ruby-operator">=&gt;</span> {},
346
+ }
347
+
348
+ <span class="ruby-identifier">plan</span> = <span class="ruby-keyword">false</span>
349
+ <span class="ruby-identifier">verbose</span> = <span class="ruby-keyword">false</span>
350
+ <span class="ruby-constant">OptionParser</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">opts</span><span class="ruby-operator">|</span>
351
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">banner</span> = <span class="ruby-string">&quot;Usage oktaSync.rb [options]&quot;</span>
352
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">&quot;-p&quot;</span>, <span class="ruby-string">&quot;--plan&quot;</span>, <span class="ruby-string">&quot;calculate changes but do not apply them&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
353
+ <span class="ruby-identifier">plan</span> = <span class="ruby-identifier">p</span>
354
+ <span class="ruby-keyword">end</span>
355
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">&quot;-v&quot;</span>, <span class="ruby-string">&quot;--verbose&quot;</span>, <span class="ruby-string">&quot;print detailed report&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
356
+ <span class="ruby-identifier">verbose</span> = <span class="ruby-identifier">v</span>
357
+ <span class="ruby-keyword">end</span>
358
+ <span class="ruby-keyword">end</span>.<span class="ruby-identifier">parse!</span>
359
+
360
+ <span class="ruby-identifier">client</span> = <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">SDM_API_ACCESS_KEY</span>, <span class="ruby-constant">SDM_API_SECRET_KEY</span>)
361
+ <span class="ruby-identifier">okta_client</span> = <span class="ruby-constant">Oktakit</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">token:</span> <span class="ruby-constant">OKTA_CLIENT_TOKEN</span>, <span class="ruby-value">api_endpoint:</span> <span class="ruby-constant">OKTA_CLIENT_ORGURL</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;/api/v1&quot;</span>)
362
+ <span class="ruby-identifier">matchers</span> = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-string">&quot;matchers.yml&quot;</span>))
363
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:matchers</span>] = <span class="ruby-identifier">matchers</span>
364
+
365
+ <span class="ruby-identifier">all_users</span> = <span class="ruby-identifier">okta_client</span>.<span class="ruby-identifier">list_users</span>({
366
+ <span class="ruby-value">&#39;query&#39;:</span> {
367
+ <span class="ruby-value">&#39;search&#39;:</span> <span class="ruby-string">&quot;profile.department eq \&quot;Engineering\&quot; and (status eq \&quot;ACTIVE\&quot;)&quot;</span>,
368
+ },
369
+ })
370
+
371
+ <span class="ruby-identifier">okta_users</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>()
372
+ <span class="ruby-identifier">all_users</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">u</span><span class="ruby-operator">|</span>
373
+ <span class="ruby-identifier">groups</span> = <span class="ruby-identifier">okta_client</span>.<span class="ruby-identifier">get_member_groups</span>(<span class="ruby-identifier">u</span>.<span class="ruby-identifier">id</span>)
374
+ <span class="ruby-identifier">group_names</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>()
375
+ <span class="ruby-identifier">groups</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">ug</span><span class="ruby-operator">|</span>
376
+ <span class="ruby-identifier">group_names</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">ug</span>.<span class="ruby-identifier">profile</span>.<span class="ruby-identifier">name</span>)
377
+ }
378
+ <span class="ruby-identifier">okta_users</span>.<span class="ruby-identifier">push</span>({ <span class="ruby-value">:login</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">u</span>.<span class="ruby-identifier">profile</span>.<span class="ruby-identifier">login</span>, <span class="ruby-value">:first_name</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">u</span>.<span class="ruby-identifier">profile</span>.<span class="ruby-identifier">firstName</span>, <span class="ruby-value">:last_name</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">u</span>.<span class="ruby-identifier">profile</span>.<span class="ruby-constant">LastName</span>, <span class="ruby-value">:groups</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">group_names</span> })
379
+ }
380
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:oktaUsers</span>] = <span class="ruby-identifier">okta_users</span>
381
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:oktaUsersCount</span>] = <span class="ruby-identifier">okta_users</span>.<span class="ruby-identifier">size</span>
382
+
383
+ <span class="ruby-identifier">accounts</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">list</span>(<span class="ruby-string">&quot;type:user&quot;</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">a</span>.<span class="ruby-identifier">email</span>, <span class="ruby-identifier">a</span>] }.<span class="ruby-identifier">to_h</span>
384
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:sdmUsers</span>] = <span class="ruby-identifier">accounts</span>
385
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:sdmUsersCount</span>] = <span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">size</span>
386
+ <span class="ruby-identifier">grants</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">account_grants</span>.<span class="ruby-identifier">list</span>(<span class="ruby-string">&quot;&quot;</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">ag</span><span class="ruby-operator">|</span> <span class="ruby-identifier">ag</span> }
387
+
388
+ <span class="ruby-identifier">current</span> = {}
389
+ <span class="ruby-identifier">grants</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span>
390
+ <span class="ruby-identifier">current</span>[<span class="ruby-identifier">g</span>.<span class="ruby-identifier">account_id</span>] = [] <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">current</span>[<span class="ruby-identifier">g</span>.<span class="ruby-identifier">account_id</span>]
391
+ <span class="ruby-identifier">current</span>[<span class="ruby-identifier">g</span>.<span class="ruby-identifier">account_id</span>].<span class="ruby-identifier">push</span>({ <span class="ruby-value">:resource_id</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">g</span>.<span class="ruby-identifier">resource_id</span>, <span class="ruby-value">:id</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">g</span>.<span class="ruby-identifier">id</span> })
392
+ }
393
+
394
+ <span class="ruby-identifier">desired</span> = {}
395
+ <span class="ruby-identifier">overlapping</span> = <span class="ruby-value">0</span>
396
+ <span class="ruby-identifier">matchers</span>[<span class="ruby-string">&quot;groups&quot;</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">group</span><span class="ruby-operator">|</span>
397
+ <span class="ruby-identifier">group</span>[<span class="ruby-string">&quot;resources&quot;</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">resourceQuery</span><span class="ruby-operator">|</span>
398
+ <span class="ruby-identifier">client</span>.<span class="ruby-identifier">resources</span>.<span class="ruby-identifier">list</span>(<span class="ruby-identifier">resourceQuery</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">res</span><span class="ruby-operator">|</span>
399
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:sdmResources</span>][<span class="ruby-identifier">res</span>.<span class="ruby-identifier">id</span>] = <span class="ruby-identifier">res</span>
400
+ <span class="ruby-identifier">okta_users</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">u</span><span class="ruby-operator">|</span>
401
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">u</span>[<span class="ruby-value">:groups</span>].<span class="ruby-identifier">include?</span> <span class="ruby-identifier">group</span>[<span class="ruby-string">&quot;name&quot;</span>]
402
+ <span class="ruby-identifier">account</span> = <span class="ruby-identifier">accounts</span>[<span class="ruby-identifier">u</span>[<span class="ruby-value">:login</span>]]
403
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">account</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
404
+ <span class="ruby-identifier">overlapping</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
405
+ <span class="ruby-identifier">desired</span>[<span class="ruby-identifier">account</span>.<span class="ruby-identifier">id</span>] = [] <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">desired</span>[<span class="ruby-identifier">account</span>.<span class="ruby-identifier">id</span>]
406
+ <span class="ruby-identifier">desired</span>[<span class="ruby-identifier">account</span>.<span class="ruby-identifier">id</span>].<span class="ruby-identifier">push</span>(<span class="ruby-identifier">res</span>.<span class="ruby-identifier">id</span>)
407
+ <span class="ruby-keyword">end</span>
408
+ <span class="ruby-keyword">end</span>
409
+ }
410
+ }
411
+ }
412
+ }
413
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:bothUsersCount</span>] = <span class="ruby-identifier">overlapping</span>
414
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:sdmResourcesCount</span>] = <span class="ruby-identifier">report</span>[<span class="ruby-value">:sdmResources</span>].<span class="ruby-identifier">size</span>
415
+
416
+ <span class="ruby-identifier">revocations</span> = <span class="ruby-value">0</span>
417
+ <span class="ruby-identifier">current</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">aid</span>, <span class="ruby-identifier">curRes</span><span class="ruby-operator">|</span>
418
+ <span class="ruby-identifier">desRes</span> = <span class="ruby-identifier">desired</span>[<span class="ruby-identifier">aid</span>]
419
+ <span class="ruby-identifier">desRes</span> = [] <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">desired</span>[<span class="ruby-identifier">aid</span>]
420
+ <span class="ruby-identifier">curRes</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
421
+ <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span>(<span class="ruby-identifier">desRes</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">r</span>[<span class="ruby-value">:resource_id</span>])
422
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">plan</span>
423
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Plan: revoke %s from user %s\n&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">r</span>[<span class="ruby-value">:resource_id</span>], <span class="ruby-identifier">aid</span>]
424
+ <span class="ruby-keyword">else</span>
425
+ <span class="ruby-identifier">client</span>.<span class="ruby-identifier">account_grants</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">r</span>[<span class="ruby-value">:id</span>])
256
426
  <span class="ruby-keyword">end</span>
257
- <span class="ruby-identifier">user</span>.<span class="ruby-identifier">suspended</span> = <span class="ruby-keyword">true</span>
258
- <span class="ruby-keyword">begin</span>
259
- <span class="ruby-identifier">client</span>.<span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">user</span>)
260
- <span class="ruby-identifier">suspended_count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
261
- <span class="ruby-keyword">rescue</span> <span class="ruby-constant">StandardError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ex</span>
262
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;skipping user &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; on account of error: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">to_s</span>
427
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:revocations</span>].<span class="ruby-identifier">push</span>(<span class="ruby-identifier">r</span>[<span class="ruby-value">:id</span>])
428
+ <span class="ruby-identifier">revocations</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
429
+ <span class="ruby-keyword">end</span>
430
+ }
431
+ }
432
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:permissionsRevoked</span>] = <span class="ruby-identifier">revocations</span>
433
+
434
+ <span class="ruby-identifier">grants</span> = <span class="ruby-value">0</span>
435
+ <span class="ruby-identifier">desired</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">aid</span>, <span class="ruby-identifier">desRes</span><span class="ruby-operator">|</span>
436
+ <span class="ruby-identifier">curRes</span> = <span class="ruby-identifier">current</span>[<span class="ruby-identifier">aid</span>]
437
+ <span class="ruby-identifier">curRes</span> = [] <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">current</span>[<span class="ruby-identifier">aid</span>]
438
+ <span class="ruby-identifier">desRes</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
439
+ <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span>(<span class="ruby-identifier">curRes</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>[<span class="ruby-value">:resource_id</span>] }.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">r</span>)
440
+ <span class="ruby-identifier">ag</span> = <span class="ruby-constant">SDM</span><span class="ruby-operator">::</span><span class="ruby-constant">AccountGrant</span>.<span class="ruby-identifier">new</span>()
441
+ <span class="ruby-identifier">ag</span>.<span class="ruby-identifier">account_id</span> = <span class="ruby-identifier">aid</span>
442
+ <span class="ruby-identifier">ag</span>.<span class="ruby-identifier">resource_id</span> = <span class="ruby-identifier">r</span>
443
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">plan</span>
444
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Plan: grant %s to user %s\n&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">r</span>, <span class="ruby-identifier">aid</span>]
445
+ <span class="ruby-keyword">else</span>
446
+ <span class="ruby-identifier">client</span>.<span class="ruby-identifier">account_grants</span>.<span class="ruby-identifier">create</span>(<span class="ruby-identifier">ag</span>)
263
447
  <span class="ruby-keyword">end</span>
448
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:grants</span>].<span class="ruby-identifier">push</span>(<span class="ruby-identifier">ag</span>)
449
+ <span class="ruby-identifier">grants</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
450
+ <span class="ruby-keyword">end</span>
264
451
  }
452
+ }
453
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:permissionsGranted</span>] = <span class="ruby-identifier">grants</span>
265
454
 
266
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;suspended &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">suspended_count</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; users&quot;</span>
455
+ <span class="ruby-identifier">report</span>[<span class="ruby-value">:complete</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
267
456
 
457
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">verbose</span>
458
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">report</span>.<span class="ruby-identifier">to_json</span>
459
+ <span class="ruby-keyword">else</span>
460
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;%d Okta users, %d strongDM users, %d overlapping users, %d grants, %d revocations&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">okta_users</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">accounts</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">overlapping</span>, <span class="ruby-identifier">grants</span>, <span class="ruby-identifier">revocations</span>]
461
+ <span class="ruby-keyword">end</span>
268
462
  <span class="ruby-keyword">end</span></pre>
269
463
  </div>
270
464
 
@@ -279,12 +473,13 @@ revert</p>
279
473
  </section>
280
474
 
281
475
  </section>
476
+
282
477
  </main>
283
478
 
284
479
 
285
480
  <footer id="validator-badges" role="contentinfo">
286
- <p><a href="http://validator.w3.org/check/referer">Validate</a>
287
- <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
481
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
482
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.2.
288
483
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
289
484
  </footer>
290
485