onelogin 1.4.1 → 3.0.0.pre.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (436) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +7 -4
  3. data/README.md +245 -423
  4. data/Rakefile +7 -3
  5. data/docs/Action.md +26 -0
  6. data/docs/ActivateFactorRequest.md +24 -0
  7. data/docs/AddAccessTokenClaimRequest.md +22 -0
  8. data/docs/AddClientAppRequest.md +20 -0
  9. data/docs/AddRoleUsers200ResponseInner.md +18 -0
  10. data/docs/AddScopeRequest.md +20 -0
  11. data/docs/AuthMethod.md +15 -0
  12. data/docs/AuthServerConfiguration.md +24 -0
  13. data/docs/ClientApp.md +20 -0
  14. data/docs/Condition.md +22 -0
  15. data/docs/Connector.md +26 -0
  16. data/docs/CreateAuthorizationServerRequest.md +22 -0
  17. data/docs/CreateEnvironmentVariableRequest.md +20 -0
  18. data/docs/CreateRoles201ResponseInner.md +18 -0
  19. data/docs/DefaultApi.md +6812 -0
  20. data/docs/Device.md +26 -0
  21. data/docs/EnrollFactorRequest.md +28 -0
  22. data/docs/Envvar.md +24 -0
  23. data/docs/ErrorStatus.md +22 -0
  24. data/docs/ErrorStatusErrorsInner.md +20 -0
  25. data/docs/FactorInner.md +32 -0
  26. data/docs/FactorInnerFactorData.md +20 -0
  27. data/docs/GenerateMfaToken200Response.md +24 -0
  28. data/docs/GenerateMfaToken422Response.md +24 -0
  29. data/docs/GenerateMfaToken422ResponseDetails.md +18 -0
  30. data/docs/GenerateMfaTokenRequest.md +20 -0
  31. data/docs/GenerateSamlAssertionRequest.md +26 -0
  32. data/docs/GenerateToken200Response.md +28 -0
  33. data/docs/GenerateToken400Response.md +18 -0
  34. data/docs/GenerateTokenRequest.md +18 -0
  35. data/docs/GetAuthorizationServer200Response.md +24 -0
  36. data/docs/GetAvailableFactors200ResponseInner.md +22 -0
  37. data/docs/GetClientApps200ResponseInner.md +24 -0
  38. data/docs/GetClientApps200ResponseInnerScopesInner.md +22 -0
  39. data/docs/GetRateLimit200Response.md +20 -0
  40. data/docs/GetRateLimit200ResponseData.md +22 -0
  41. data/docs/GetRiskScore200Response.md +20 -0
  42. data/docs/GetRiskScore400Response.md +18 -0
  43. data/docs/GetRiskScoreRequest.md +30 -0
  44. data/docs/GetScoreInsights200Response.md +20 -0
  45. data/docs/GetScoreInsights200ResponseScores.md +26 -0
  46. data/docs/GetUserApps200ResponseInner.md +32 -0
  47. data/docs/Hook.md +46 -0
  48. data/docs/HookConditionsInner.md +22 -0
  49. data/docs/HookOptions.md +22 -0
  50. data/docs/HookStatus.md +20 -0
  51. data/docs/Id.md +18 -0
  52. data/docs/ListAccessTokenClaims200ResponseInner.md +34 -0
  53. data/docs/ListActions200ResponseInner.md +20 -0
  54. data/docs/ListAppUsers200ResponseInner.md +26 -0
  55. data/docs/ListAuthorizationServers200ResponseInner.md +24 -0
  56. data/docs/ListAuthorizationServers200ResponseInnerConfiguration.md +20 -0
  57. data/docs/ListConditionOperators200ResponseInner.md +20 -0
  58. data/docs/ListConditionValues200ResponseInner.md +20 -0
  59. data/docs/ListConditions200ResponseInner.md +20 -0
  60. data/docs/ListMappingConditionOperators200ResponseInner.md +20 -0
  61. data/docs/ListMappingConditions200ResponseInner.md +20 -0
  62. data/docs/ListScopes200ResponseInner.md +22 -0
  63. data/docs/Log.md +24 -0
  64. data/docs/Mapping.md +30 -0
  65. data/docs/Registration.md +22 -0
  66. data/docs/RemoveRoleUsersRequest.md +18 -0
  67. data/docs/RevokeTokenRequest.md +18 -0
  68. data/docs/RiskDevice.md +18 -0
  69. data/docs/RiskRule.md +30 -0
  70. data/docs/RiskUser.md +22 -0
  71. data/docs/Role.md +26 -0
  72. data/docs/Rule.md +30 -0
  73. data/docs/RuleId.md +18 -0
  74. data/docs/Schema.md +56 -0
  75. data/docs/Schema1.md +28 -0
  76. data/docs/Schema1AddedBy.md +20 -0
  77. data/docs/SchemaProvisioning.md +18 -0
  78. data/docs/Session.md +18 -0
  79. data/docs/SetRoleApps200ResponseInner.md +18 -0
  80. data/docs/Source.md +20 -0
  81. data/docs/Status.md +24 -0
  82. data/docs/Status1.md +22 -0
  83. data/docs/Status2.md +18 -0
  84. data/docs/Status2Status.md +24 -0
  85. data/docs/TrackEventRequest.md +34 -0
  86. data/docs/UpdateAuthorizationServer400Response.md +24 -0
  87. data/docs/UpdateClientAppRequest.md +18 -0
  88. data/docs/UpdateEnvironmentVariableRequest.md +18 -0
  89. data/docs/UpdateRole200Response.md +18 -0
  90. data/docs/User.md +90 -0
  91. data/docs/VerifyEnrollmentRequest.md +18 -0
  92. data/docs/VerifyFactorRequest.md +20 -0
  93. data/docs/VerifyFactorSaml200Response.md +20 -0
  94. data/docs/VerifyFactorSamlRequest.md +26 -0
  95. data/docs/VerifyFactorVoice200ResponseInner.md +22 -0
  96. data/git_push.sh +57 -0
  97. data/lib/onelogin/api/default_api.rb +7334 -0
  98. data/lib/onelogin/api_client.rb +391 -0
  99. data/lib/onelogin/api_error.rb +57 -0
  100. data/lib/onelogin/configuration.rb +282 -0
  101. data/lib/onelogin/models/action.rb +262 -0
  102. data/lib/onelogin/models/activate_factor_request.rb +250 -0
  103. data/lib/onelogin/models/add_access_token_claim_request.rb +237 -0
  104. data/lib/onelogin/models/add_client_app_request.rb +230 -0
  105. data/lib/onelogin/models/add_role_users200_response_inner.rb +219 -0
  106. data/lib/onelogin/models/add_scope_request.rb +228 -0
  107. data/lib/onelogin/models/auth_method.rb +43 -0
  108. data/lib/onelogin/models/auth_server_configuration.rb +248 -0
  109. data/lib/onelogin/models/client_app.rb +228 -0
  110. data/lib/onelogin/models/condition.rb +240 -0
  111. data/lib/onelogin/models/connector.rb +259 -0
  112. data/lib/onelogin/models/create_authorization_server_request.rb +237 -0
  113. data/lib/onelogin/models/create_environment_variable_request.rb +240 -0
  114. data/lib/onelogin/models/create_roles201_response_inner.rb +219 -0
  115. data/lib/onelogin/models/device.rb +255 -0
  116. data/lib/onelogin/models/enroll_factor_request.rb +280 -0
  117. data/lib/onelogin/models/envvar.rb +250 -0
  118. data/lib/onelogin/models/error_status.rb +239 -0
  119. data/lib/onelogin/models/error_status_errors_inner.rb +230 -0
  120. data/lib/onelogin/models/factor_inner.rb +323 -0
  121. data/lib/onelogin/models/factor_inner_factor_data.rb +231 -0
  122. data/lib/onelogin/models/generate_mfa_token200_response.rb +250 -0
  123. data/lib/onelogin/models/generate_mfa_token422_response.rb +246 -0
  124. data/lib/onelogin/models/generate_mfa_token422_response_details.rb +221 -0
  125. data/lib/onelogin/models/generate_mfa_token_request.rb +230 -0
  126. data/lib/onelogin/models/generate_saml_assertion_request.rb +280 -0
  127. data/lib/onelogin/models/generate_token200_response.rb +264 -0
  128. data/lib/onelogin/models/generate_token400_response.rb +219 -0
  129. data/lib/onelogin/models/generate_token_request.rb +253 -0
  130. data/lib/onelogin/models/get_authorization_server200_response.rb +246 -0
  131. data/lib/onelogin/models/get_available_factors200_response_inner.rb +240 -0
  132. data/lib/onelogin/models/get_client_apps200_response_inner.rb +248 -0
  133. data/lib/onelogin/models/get_client_apps200_response_inner_scopes_inner.rb +237 -0
  134. data/lib/onelogin/models/get_rate_limit200_response.rb +228 -0
  135. data/lib/onelogin/models/get_rate_limit200_response_data.rb +237 -0
  136. data/lib/onelogin/models/get_risk_score200_response.rb +256 -0
  137. data/lib/onelogin/models/get_risk_score400_response.rb +221 -0
  138. data/lib/onelogin/models/get_risk_score_request.rb +291 -0
  139. data/lib/onelogin/models/get_score_insights200_response.rb +228 -0
  140. data/lib/onelogin/models/get_score_insights200_response_scores.rb +255 -0
  141. data/lib/onelogin/models/get_user_apps200_response_inner.rb +335 -0
  142. data/lib/onelogin/models/hook.rb +462 -0
  143. data/lib/onelogin/models/hook_conditions_inner.rb +237 -0
  144. data/lib/onelogin/models/hook_options.rb +238 -0
  145. data/lib/onelogin/models/hook_status.rb +228 -0
  146. data/lib/onelogin/models/id.rb +219 -0
  147. data/lib/onelogin/models/list_access_token_claims200_response_inner.rb +293 -0
  148. data/lib/onelogin/models/list_actions200_response_inner.rb +230 -0
  149. data/lib/onelogin/models/list_app_users200_response_inner.rb +255 -0
  150. data/lib/onelogin/models/list_authorization_servers200_response_inner.rb +246 -0
  151. data/lib/onelogin/models/list_authorization_servers200_response_inner_configuration.rb +230 -0
  152. data/lib/onelogin/models/list_condition_operators200_response_inner.rb +230 -0
  153. data/lib/onelogin/models/list_condition_values200_response_inner.rb +228 -0
  154. data/lib/onelogin/models/list_conditions200_response_inner.rb +230 -0
  155. data/lib/onelogin/models/list_mapping_condition_operators200_response_inner.rb +230 -0
  156. data/lib/onelogin/models/list_mapping_conditions200_response_inner.rb +230 -0
  157. data/lib/onelogin/models/list_scopes200_response_inner.rb +237 -0
  158. data/lib/onelogin/models/log.rb +248 -0
  159. data/lib/onelogin/models/mapping.rb +342 -0
  160. data/lib/onelogin/models/registration.rb +274 -0
  161. data/lib/onelogin/models/remove_role_users_request.rb +221 -0
  162. data/lib/onelogin/models/revoke_token_request.rb +219 -0
  163. data/lib/onelogin/models/risk_device.rb +221 -0
  164. data/lib/onelogin/models/risk_rule.rb +325 -0
  165. data/lib/onelogin/models/risk_user.rb +248 -0
  166. data/lib/onelogin/models/role.rb +266 -0
  167. data/lib/onelogin/models/rule.rb +317 -0
  168. data/lib/onelogin/models/rule_id.rb +219 -0
  169. data/lib/onelogin/models/schema.rb +441 -0
  170. data/lib/onelogin/models/schema1.rb +265 -0
  171. data/lib/onelogin/models/schema1_added_by.rb +228 -0
  172. data/lib/onelogin/models/schema_provisioning.rb +220 -0
  173. data/lib/onelogin/models/session.rb +221 -0
  174. data/lib/onelogin/models/set_role_apps200_response_inner.rb +220 -0
  175. data/lib/onelogin/models/source.rb +230 -0
  176. data/lib/onelogin/models/status.rb +246 -0
  177. data/lib/onelogin/models/status1.rb +237 -0
  178. data/lib/onelogin/models/status2.rb +219 -0
  179. data/lib/onelogin/models/status2_status.rb +246 -0
  180. data/lib/onelogin/models/track_event_request.rb +316 -0
  181. data/lib/onelogin/models/update_authorization_server400_response.rb +246 -0
  182. data/lib/onelogin/models/update_client_app_request.rb +221 -0
  183. data/lib/onelogin/models/update_environment_variable_request.rb +225 -0
  184. data/lib/onelogin/models/update_role200_response.rb +219 -0
  185. data/lib/onelogin/models/user.rb +615 -0
  186. data/lib/onelogin/models/verify_enrollment_request.rb +219 -0
  187. data/lib/onelogin/models/verify_factor_request.rb +230 -0
  188. data/lib/onelogin/models/verify_factor_saml200_response.rb +230 -0
  189. data/lib/onelogin/models/verify_factor_saml_request.rb +275 -0
  190. data/lib/onelogin/models/verify_factor_voice200_response_inner.rb +271 -0
  191. data/lib/onelogin/version.rb +13 -1
  192. data/lib/onelogin.rb +130 -1
  193. data/onelogin.gemspec +36 -43
  194. data/spec/api/default_api_spec.rb +1259 -0
  195. data/spec/api_client_spec.rb +226 -0
  196. data/spec/configuration_spec.rb +42 -0
  197. data/spec/models/action_spec.rb +58 -0
  198. data/spec/models/activate_factor_request_spec.rb +52 -0
  199. data/spec/models/add_access_token_claim_request_spec.rb +46 -0
  200. data/spec/models/add_client_app_request_spec.rb +40 -0
  201. data/spec/models/add_role_users200_response_inner_spec.rb +34 -0
  202. data/spec/models/add_scope_request_spec.rb +40 -0
  203. data/spec/models/auth_method_spec.rb +28 -0
  204. data/spec/models/auth_server_configuration_spec.rb +52 -0
  205. data/spec/models/client_app_spec.rb +40 -0
  206. data/spec/models/condition_spec.rb +46 -0
  207. data/spec/models/connector_spec.rb +58 -0
  208. data/spec/models/create_authorization_server_request_spec.rb +46 -0
  209. data/spec/models/create_environment_variable_request_spec.rb +40 -0
  210. data/spec/models/create_roles201_response_inner_spec.rb +34 -0
  211. data/spec/models/device_spec.rb +58 -0
  212. data/spec/models/enroll_factor_request_spec.rb +64 -0
  213. data/spec/models/envvar_spec.rb +52 -0
  214. data/spec/models/error_status_errors_inner_spec.rb +40 -0
  215. data/spec/models/error_status_spec.rb +46 -0
  216. data/spec/models/factor_inner_factor_data_spec.rb +40 -0
  217. data/spec/models/factor_inner_spec.rb +80 -0
  218. data/spec/models/generate_mfa_token200_response_spec.rb +52 -0
  219. data/spec/models/generate_mfa_token422_response_details_spec.rb +34 -0
  220. data/spec/models/generate_mfa_token422_response_spec.rb +52 -0
  221. data/spec/models/generate_mfa_token_request_spec.rb +40 -0
  222. data/spec/models/generate_saml_assertion_request_spec.rb +58 -0
  223. data/spec/models/generate_token200_response_spec.rb +64 -0
  224. data/spec/models/generate_token400_response_spec.rb +34 -0
  225. data/spec/models/generate_token_request_spec.rb +38 -0
  226. data/spec/models/get_authorization_server200_response_spec.rb +52 -0
  227. data/spec/models/get_available_factors200_response_inner_spec.rb +46 -0
  228. data/spec/models/get_client_apps200_response_inner_scopes_inner_spec.rb +46 -0
  229. data/spec/models/get_client_apps200_response_inner_spec.rb +52 -0
  230. data/spec/models/get_rate_limit200_response_data_spec.rb +46 -0
  231. data/spec/models/get_rate_limit200_response_spec.rb +40 -0
  232. data/spec/models/get_risk_score200_response_spec.rb +40 -0
  233. data/spec/models/get_risk_score400_response_spec.rb +34 -0
  234. data/spec/models/get_risk_score_request_spec.rb +70 -0
  235. data/spec/models/get_score_insights200_response_scores_spec.rb +58 -0
  236. data/spec/models/get_score_insights200_response_spec.rb +40 -0
  237. data/spec/models/get_user_apps200_response_inner_spec.rb +84 -0
  238. data/spec/models/hook_conditions_inner_spec.rb +46 -0
  239. data/spec/models/hook_options_spec.rb +46 -0
  240. data/spec/models/hook_spec.rb +122 -0
  241. data/spec/models/hook_status_spec.rb +40 -0
  242. data/spec/models/id_spec.rb +34 -0
  243. data/spec/models/list_access_token_claims200_response_inner_spec.rb +82 -0
  244. data/spec/models/list_actions200_response_inner_spec.rb +40 -0
  245. data/spec/models/list_app_users200_response_inner_spec.rb +58 -0
  246. data/spec/models/list_authorization_servers200_response_inner_configuration_spec.rb +40 -0
  247. data/spec/models/list_authorization_servers200_response_inner_spec.rb +52 -0
  248. data/spec/models/list_condition_operators200_response_inner_spec.rb +40 -0
  249. data/spec/models/list_condition_values200_response_inner_spec.rb +40 -0
  250. data/spec/models/list_conditions200_response_inner_spec.rb +40 -0
  251. data/spec/models/list_mapping_condition_operators200_response_inner_spec.rb +40 -0
  252. data/spec/models/list_mapping_conditions200_response_inner_spec.rb +40 -0
  253. data/spec/models/list_scopes200_response_inner_spec.rb +46 -0
  254. data/spec/models/log_spec.rb +52 -0
  255. data/spec/models/mapping_spec.rb +74 -0
  256. data/spec/models/registration_spec.rb +50 -0
  257. data/spec/models/remove_role_users_request_spec.rb +34 -0
  258. data/spec/models/revoke_token_request_spec.rb +34 -0
  259. data/spec/models/risk_device_spec.rb +34 -0
  260. data/spec/models/risk_rule_spec.rb +78 -0
  261. data/spec/models/risk_user_spec.rb +46 -0
  262. data/spec/models/role_spec.rb +58 -0
  263. data/spec/models/rule_id_spec.rb +34 -0
  264. data/spec/models/rule_spec.rb +74 -0
  265. data/spec/models/schema1_added_by_spec.rb +40 -0
  266. data/spec/models/schema1_spec.rb +64 -0
  267. data/spec/models/schema_provisioning_spec.rb +34 -0
  268. data/spec/models/schema_spec.rb +152 -0
  269. data/spec/models/session_spec.rb +34 -0
  270. data/spec/models/set_role_apps200_response_inner_spec.rb +34 -0
  271. data/spec/models/source_spec.rb +40 -0
  272. data/spec/models/status1_spec.rb +46 -0
  273. data/spec/models/status2_spec.rb +34 -0
  274. data/spec/models/status2_status_spec.rb +52 -0
  275. data/spec/models/status_spec.rb +52 -0
  276. data/spec/models/track_event_request_spec.rb +82 -0
  277. data/spec/models/update_authorization_server400_response_spec.rb +52 -0
  278. data/spec/models/update_client_app_request_spec.rb +34 -0
  279. data/spec/models/update_environment_variable_request_spec.rb +34 -0
  280. data/spec/models/update_role200_response_spec.rb +34 -0
  281. data/spec/models/user_spec.rb +258 -0
  282. data/spec/models/verify_enrollment_request_spec.rb +34 -0
  283. data/spec/models/verify_factor_request_spec.rb +40 -0
  284. data/spec/models/verify_factor_saml200_response_spec.rb +40 -0
  285. data/spec/models/verify_factor_saml_request_spec.rb +58 -0
  286. data/spec/models/verify_factor_voice200_response_inner_spec.rb +50 -0
  287. data/spec/spec_helper.rb +111 -0
  288. metadata +402 -210
  289. data/.gitignore +0 -12
  290. data/.travis.yml +0 -6
  291. data/bin/console +0 -14
  292. data/bin/setup +0 -6
  293. data/examples/Gemfile +0 -3
  294. data/examples/Gemfile.lock +0 -21
  295. data/examples/README.md +0 -19
  296. data/examples/all-users-to-csv.rb +0 -48
  297. data/examples/create-user.rb +0 -16
  298. data/examples/events-to-csv.rb +0 -93
  299. data/examples/last-app-user-login-to-csv.rb +0 -72
  300. data/examples/list-users.rb +0 -15
  301. data/examples/rails-custom-login-page/.gitignore +0 -45
  302. data/examples/rails-custom-login-page/.ruby-version +0 -1
  303. data/examples/rails-custom-login-page/Gemfile +0 -57
  304. data/examples/rails-custom-login-page/Gemfile.lock +0 -208
  305. data/examples/rails-custom-login-page/README.md +0 -105
  306. data/examples/rails-custom-login-page/Rakefile +0 -6
  307. data/examples/rails-custom-login-page/app/assets/config/manifest.js +0 -3
  308. data/examples/rails-custom-login-page/app/assets/images/.keep +0 -0
  309. data/examples/rails-custom-login-page/app/assets/javascripts/application.js +0 -18
  310. data/examples/rails-custom-login-page/app/assets/javascripts/cable.js +0 -13
  311. data/examples/rails-custom-login-page/app/assets/javascripts/channels/.keep +0 -0
  312. data/examples/rails-custom-login-page/app/assets/javascripts/dashboard.coffee +0 -3
  313. data/examples/rails-custom-login-page/app/assets/javascripts/home.coffee +0 -3
  314. data/examples/rails-custom-login-page/app/assets/javascripts/sessions.coffee +0 -3
  315. data/examples/rails-custom-login-page/app/assets/stylesheets/application.css +0 -15
  316. data/examples/rails-custom-login-page/app/assets/stylesheets/dashboard.scss +0 -3
  317. data/examples/rails-custom-login-page/app/assets/stylesheets/home.scss +0 -3
  318. data/examples/rails-custom-login-page/app/assets/stylesheets/sessions.scss +0 -3
  319. data/examples/rails-custom-login-page/app/channels/application_cable/channel.rb +0 -4
  320. data/examples/rails-custom-login-page/app/channels/application_cable/connection.rb +0 -4
  321. data/examples/rails-custom-login-page/app/controllers/application_controller.rb +0 -23
  322. data/examples/rails-custom-login-page/app/controllers/concerns/.keep +0 -0
  323. data/examples/rails-custom-login-page/app/controllers/dashboard_controller.rb +0 -10
  324. data/examples/rails-custom-login-page/app/controllers/home_controller.rb +0 -4
  325. data/examples/rails-custom-login-page/app/controllers/sessions_controller.rb +0 -46
  326. data/examples/rails-custom-login-page/app/controllers/users_controller.rb +0 -116
  327. data/examples/rails-custom-login-page/app/helpers/application_helper.rb +0 -2
  328. data/examples/rails-custom-login-page/app/helpers/dashboard_helper.rb +0 -28
  329. data/examples/rails-custom-login-page/app/helpers/home_helper.rb +0 -2
  330. data/examples/rails-custom-login-page/app/helpers/sessions_helper.rb +0 -87
  331. data/examples/rails-custom-login-page/app/helpers/users_helper.rb +0 -3
  332. data/examples/rails-custom-login-page/app/jobs/application_job.rb +0 -2
  333. data/examples/rails-custom-login-page/app/mailers/application_mailer.rb +0 -4
  334. data/examples/rails-custom-login-page/app/models/application_record.rb +0 -3
  335. data/examples/rails-custom-login-page/app/models/concerns/.keep +0 -0
  336. data/examples/rails-custom-login-page/app/views/dashboard/index.html.erb +0 -50
  337. data/examples/rails-custom-login-page/app/views/home/index.html.erb +0 -209
  338. data/examples/rails-custom-login-page/app/views/layouts/application.html.erb +0 -31
  339. data/examples/rails-custom-login-page/app/views/layouts/mailer.html.erb +0 -13
  340. data/examples/rails-custom-login-page/app/views/layouts/mailer.text.erb +0 -1
  341. data/examples/rails-custom-login-page/app/views/users/_form.html.erb +0 -1
  342. data/examples/rails-custom-login-page/app/views/users/_user.json.jbuilder +0 -2
  343. data/examples/rails-custom-login-page/app/views/users/edit.html.erb +0 -27
  344. data/examples/rails-custom-login-page/app/views/users/index.html.erb +0 -30
  345. data/examples/rails-custom-login-page/app/views/users/index.json.jbuilder +0 -1
  346. data/examples/rails-custom-login-page/app/views/users/new.html.erb +0 -60
  347. data/examples/rails-custom-login-page/app/views/users/onboard.html.erb +0 -54
  348. data/examples/rails-custom-login-page/app/views/users/show.html.erb +0 -14
  349. data/examples/rails-custom-login-page/app/views/users/show.json.jbuilder +0 -1
  350. data/examples/rails-custom-login-page/bin/bundle +0 -3
  351. data/examples/rails-custom-login-page/bin/rails +0 -9
  352. data/examples/rails-custom-login-page/bin/rake +0 -9
  353. data/examples/rails-custom-login-page/bin/setup +0 -38
  354. data/examples/rails-custom-login-page/bin/spring +0 -17
  355. data/examples/rails-custom-login-page/bin/update +0 -29
  356. data/examples/rails-custom-login-page/bin/yarn +0 -11
  357. data/examples/rails-custom-login-page/config/application.rb +0 -18
  358. data/examples/rails-custom-login-page/config/boot.rb +0 -3
  359. data/examples/rails-custom-login-page/config/cable.yml +0 -10
  360. data/examples/rails-custom-login-page/config/database.yml +0 -25
  361. data/examples/rails-custom-login-page/config/environment.rb +0 -5
  362. data/examples/rails-custom-login-page/config/environments/development.rb +0 -54
  363. data/examples/rails-custom-login-page/config/environments/production.rb +0 -91
  364. data/examples/rails-custom-login-page/config/environments/test.rb +0 -42
  365. data/examples/rails-custom-login-page/config/initializers/application_controller_renderer.rb +0 -8
  366. data/examples/rails-custom-login-page/config/initializers/assets.rb +0 -14
  367. data/examples/rails-custom-login-page/config/initializers/backtrace_silencers.rb +0 -7
  368. data/examples/rails-custom-login-page/config/initializers/cookies_serializer.rb +0 -5
  369. data/examples/rails-custom-login-page/config/initializers/filter_parameter_logging.rb +0 -4
  370. data/examples/rails-custom-login-page/config/initializers/inflections.rb +0 -16
  371. data/examples/rails-custom-login-page/config/initializers/mime_types.rb +0 -4
  372. data/examples/rails-custom-login-page/config/initializers/onelogin.rb +0 -4
  373. data/examples/rails-custom-login-page/config/initializers/wrap_parameters.rb +0 -14
  374. data/examples/rails-custom-login-page/config/locales/en.yml +0 -33
  375. data/examples/rails-custom-login-page/config/puma.rb +0 -56
  376. data/examples/rails-custom-login-page/config/routes.rb +0 -23
  377. data/examples/rails-custom-login-page/config/secrets.yml.sample +0 -36
  378. data/examples/rails-custom-login-page/config/spring.rb +0 -6
  379. data/examples/rails-custom-login-page/config.ru +0 -5
  380. data/examples/rails-custom-login-page/db/seeds.rb +0 -7
  381. data/examples/rails-custom-login-page/lib/assets/.keep +0 -0
  382. data/examples/rails-custom-login-page/lib/tasks/.keep +0 -0
  383. data/examples/rails-custom-login-page/package.json +0 -5
  384. data/examples/rails-custom-login-page/public/404.html +0 -67
  385. data/examples/rails-custom-login-page/public/422.html +0 -67
  386. data/examples/rails-custom-login-page/public/500.html +0 -66
  387. data/examples/rails-custom-login-page/public/apple-touch-icon-precomposed.png +0 -0
  388. data/examples/rails-custom-login-page/public/apple-touch-icon.png +0 -0
  389. data/examples/rails-custom-login-page/public/favicon.ico +0 -0
  390. data/examples/rails-custom-login-page/public/robots.txt +0 -1
  391. data/examples/rails-custom-login-page/test/application_system_test_case.rb +0 -5
  392. data/examples/rails-custom-login-page/test/controllers/.keep +0 -0
  393. data/examples/rails-custom-login-page/test/controllers/dashboard_controller_test.rb +0 -9
  394. data/examples/rails-custom-login-page/test/controllers/home_controller_test.rb +0 -9
  395. data/examples/rails-custom-login-page/test/controllers/sessions_controller_test.rb +0 -7
  396. data/examples/rails-custom-login-page/test/controllers/users_controller_test.rb +0 -48
  397. data/examples/rails-custom-login-page/test/fixtures/.keep +0 -0
  398. data/examples/rails-custom-login-page/test/fixtures/files/.keep +0 -0
  399. data/examples/rails-custom-login-page/test/helpers/.keep +0 -0
  400. data/examples/rails-custom-login-page/test/integration/.keep +0 -0
  401. data/examples/rails-custom-login-page/test/mailers/.keep +0 -0
  402. data/examples/rails-custom-login-page/test/models/.keep +0 -0
  403. data/examples/rails-custom-login-page/test/system/.keep +0 -0
  404. data/examples/rails-custom-login-page/test/test_helper.rb +0 -9
  405. data/examples/rails-custom-login-page/vendor/.keep +0 -0
  406. data/lib/onelogin/api/apiexception.rb +0 -10
  407. data/lib/onelogin/api/client.rb +0 -2328
  408. data/lib/onelogin/api/cursor.rb +0 -113
  409. data/lib/onelogin/api/models/app.rb +0 -22
  410. data/lib/onelogin/api/models/auth_factor.rb +0 -16
  411. data/lib/onelogin/api/models/device.rb +0 -18
  412. data/lib/onelogin/api/models/embed_app.rb +0 -31
  413. data/lib/onelogin/api/models/event.rb +0 -54
  414. data/lib/onelogin/api/models/event_type.rb +0 -17
  415. data/lib/onelogin/api/models/factor_enrollment_response.rb +0 -22
  416. data/lib/onelogin/api/models/group.rb +0 -17
  417. data/lib/onelogin/api/models/mfa.rb +0 -26
  418. data/lib/onelogin/api/models/mfa_token.rb +0 -18
  419. data/lib/onelogin/api/models/onelogin_token.rb +0 -20
  420. data/lib/onelogin/api/models/otp_device.rb +0 -25
  421. data/lib/onelogin/api/models/privilege.rb +0 -51
  422. data/lib/onelogin/api/models/rate_limit.rb +0 -17
  423. data/lib/onelogin/api/models/role.rb +0 -16
  424. data/lib/onelogin/api/models/saml_endpoint_response.rb +0 -18
  425. data/lib/onelogin/api/models/session_token_info.rb +0 -21
  426. data/lib/onelogin/api/models/session_token_mfa_info.rb +0 -26
  427. data/lib/onelogin/api/models/statement.rb +0 -36
  428. data/lib/onelogin/api/models/user.rb +0 -135
  429. data/lib/onelogin/api/models/user_data.rb +0 -13
  430. data/lib/onelogin/api/models/user_metadata.rb +0 -13
  431. data/lib/onelogin/api/models.rb +0 -22
  432. data/lib/onelogin/api/util/constants.rb +0 -160
  433. data/lib/onelogin/api/util/parser.rb +0 -56
  434. data/lib/onelogin/api/util/url_builder.rb +0 -24
  435. data/lib/onelogin/api/util.rb +0 -13
  436. data/lib/onelogin/api.rb +0 -2
@@ -0,0 +1,391 @@
1
+ =begin
2
+ #OneLogin API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 3.0.0-alpha.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'json'
15
+ require 'logger'
16
+ require 'tempfile'
17
+ require 'time'
18
+ require 'typhoeus'
19
+
20
+ module OneLogin
21
+ class ApiClient
22
+ # The Configuration object holding settings to be used in the API client.
23
+ attr_accessor :config
24
+
25
+ # Defines the headers to be used in HTTP requests of all API calls by default.
26
+ #
27
+ # @return [Hash]
28
+ attr_accessor :default_headers
29
+
30
+ # Initializes the ApiClient
31
+ # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
32
+ def initialize(config = Configuration.default)
33
+ @config = config
34
+ @user_agent = "OpenAPI-Generator/#{VERSION}/ruby"
35
+ @default_headers = {
36
+ 'Content-Type' => 'application/json',
37
+ 'User-Agent' => @user_agent
38
+ }
39
+ end
40
+
41
+ def self.default
42
+ @@default ||= ApiClient.new
43
+ end
44
+
45
+ # Call an API with given options.
46
+ #
47
+ # @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
48
+ # the data deserialized from response body (could be nil), response status code and response headers.
49
+ def call_api(http_method, path, opts = {})
50
+ request = build_request(http_method, path, opts)
51
+ response = request.run
52
+
53
+ if @config.debugging
54
+ @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
55
+ end
56
+
57
+ unless response.success?
58
+ if response.timed_out?
59
+ fail ApiError.new('Connection timed out')
60
+ elsif response.code == 0
61
+ # Errors from libcurl will be made visible here
62
+ fail ApiError.new(:code => 0,
63
+ :message => response.return_message)
64
+ else
65
+ fail ApiError.new(:code => response.code,
66
+ :response_headers => response.headers,
67
+ :response_body => response.body),
68
+ response.status_message
69
+ end
70
+ end
71
+
72
+ if opts[:return_type]
73
+ data = deserialize(response, opts[:return_type])
74
+ else
75
+ data = nil
76
+ end
77
+ return data, response.code, response.headers
78
+ end
79
+
80
+ # Builds the HTTP request
81
+ #
82
+ # @param [String] http_method HTTP method/verb (e.g. POST)
83
+ # @param [String] path URL path (e.g. /account/new)
84
+ # @option opts [Hash] :header_params Header parameters
85
+ # @option opts [Hash] :query_params Query parameters
86
+ # @option opts [Hash] :form_params Query parameters
87
+ # @option opts [Object] :body HTTP body (JSON/XML)
88
+ # @return [Typhoeus::Request] A Typhoeus Request
89
+ def build_request(http_method, path, opts = {})
90
+ url = build_request_url(path, opts)
91
+ http_method = http_method.to_sym.downcase
92
+
93
+ header_params = @default_headers.merge(opts[:header_params] || {})
94
+ query_params = opts[:query_params] || {}
95
+ form_params = opts[:form_params] || {}
96
+ follow_location = opts[:follow_location] || true
97
+
98
+
99
+ # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
100
+ _verify_ssl_host = @config.verify_ssl_host ? 2 : 0
101
+
102
+ req_opts = {
103
+ :method => http_method,
104
+ :headers => header_params,
105
+ :params => query_params,
106
+ :params_encoding => @config.params_encoding,
107
+ :timeout => @config.timeout,
108
+ :ssl_verifypeer => @config.verify_ssl,
109
+ :ssl_verifyhost => _verify_ssl_host,
110
+ :sslcert => @config.cert_file,
111
+ :sslkey => @config.key_file,
112
+ :verbose => @config.debugging,
113
+ :followlocation => follow_location
114
+ }
115
+
116
+ # set custom cert, if provided
117
+ req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
118
+
119
+ if [:post, :patch, :put, :delete].include?(http_method)
120
+ req_body = build_request_body(header_params, form_params, opts[:body])
121
+ req_opts.update :body => req_body
122
+ if @config.debugging
123
+ @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
124
+ end
125
+ end
126
+
127
+ request = Typhoeus::Request.new(url, req_opts)
128
+ download_file(request) if opts[:return_type] == 'File'
129
+ request
130
+ end
131
+
132
+ # Builds the HTTP request body
133
+ #
134
+ # @param [Hash] header_params Header parameters
135
+ # @param [Hash] form_params Query parameters
136
+ # @param [Object] body HTTP body (JSON/XML)
137
+ # @return [String] HTTP body data in the form of string
138
+ def build_request_body(header_params, form_params, body)
139
+ # http form
140
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
141
+ header_params['Content-Type'] == 'multipart/form-data'
142
+ data = {}
143
+ form_params.each do |key, value|
144
+ case value
145
+ when ::File, ::Array, nil
146
+ # let typhoeus handle File, Array and nil parameters
147
+ data[key] = value
148
+ else
149
+ data[key] = value.to_s
150
+ end
151
+ end
152
+ elsif body
153
+ data = body.is_a?(String) ? body : body.to_json
154
+ else
155
+ data = nil
156
+ end
157
+ data
158
+ end
159
+
160
+ # Save response body into a file in (the defined) temporary folder, using the filename
161
+ # from the "Content-Disposition" header if provided, otherwise a random filename.
162
+ # The response body is written to the file in chunks in order to handle files which
163
+ # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
164
+ # process can use.
165
+ #
166
+ # @see Configuration#temp_folder_path
167
+ def download_file(request)
168
+ tempfile = nil
169
+ encoding = nil
170
+ request.on_headers do |response|
171
+ content_disposition = response.headers['Content-Disposition']
172
+ if content_disposition && content_disposition =~ /filename=/i
173
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
174
+ prefix = sanitize_filename(filename)
175
+ else
176
+ prefix = 'download-'
177
+ end
178
+ prefix = prefix + '-' unless prefix.end_with?('-')
179
+ encoding = response.body.encoding
180
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
181
+ @tempfile = tempfile
182
+ end
183
+ request.on_body do |chunk|
184
+ chunk.force_encoding(encoding)
185
+ tempfile.write(chunk)
186
+ end
187
+ request.on_complete do |response|
188
+ if tempfile
189
+ tempfile.close
190
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
191
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
192
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
193
+ "explicitly with `tempfile.delete`"
194
+ end
195
+ end
196
+ end
197
+
198
+ # Check if the given MIME is a JSON MIME.
199
+ # JSON MIME examples:
200
+ # application/json
201
+ # application/json; charset=UTF8
202
+ # APPLICATION/JSON
203
+ # */*
204
+ # @param [String] mime MIME
205
+ # @return [Boolean] True if the MIME is application/json
206
+ def json_mime?(mime)
207
+ (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
208
+ end
209
+
210
+ # Deserialize the response to the given return type.
211
+ #
212
+ # @param [Response] response HTTP response
213
+ # @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
214
+ def deserialize(response, return_type)
215
+ body = response.body
216
+
217
+ # handle file downloading - return the File instance processed in request callbacks
218
+ # note that response body is empty when the file is written in chunks in request on_body callback
219
+ return @tempfile if return_type == 'File'
220
+
221
+ return nil if body.nil? || body.empty?
222
+
223
+ # return response body directly for String return type
224
+ return body if return_type == 'String'
225
+
226
+ # ensuring a default content type
227
+ content_type = response.headers['Content-Type'] || 'application/json'
228
+
229
+ fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
230
+
231
+ begin
232
+ data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
233
+ rescue JSON::ParserError => e
234
+ if %w(String Date Time).include?(return_type)
235
+ data = body
236
+ else
237
+ raise e
238
+ end
239
+ end
240
+
241
+ convert_to_type data, return_type
242
+ end
243
+
244
+ # Convert data to the given return type.
245
+ # @param [Object] data Data to be converted
246
+ # @param [String] return_type Return type
247
+ # @return [Mixed] Data in a particular type
248
+ def convert_to_type(data, return_type)
249
+ return nil if data.nil?
250
+ case return_type
251
+ when 'String'
252
+ data.to_s
253
+ when 'Integer'
254
+ data.to_i
255
+ when 'Float'
256
+ data.to_f
257
+ when 'Boolean'
258
+ data == true
259
+ when 'Time'
260
+ # parse date time (expecting ISO 8601 format)
261
+ Time.parse data
262
+ when 'Date'
263
+ # parse date time (expecting ISO 8601 format)
264
+ Date.parse data
265
+ when 'Object'
266
+ # generic object (usually a Hash), return directly
267
+ data
268
+ when /\AArray<(.+)>\z/
269
+ # e.g. Array<Pet>
270
+ sub_type = $1
271
+ data.map { |item| convert_to_type(item, sub_type) }
272
+ when /\AHash\<String, (.+)\>\z/
273
+ # e.g. Hash<String, Integer>
274
+ sub_type = $1
275
+ {}.tap do |hash|
276
+ data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
277
+ end
278
+ else
279
+ # models (e.g. Pet) or oneOf
280
+ klass = OneLogin.const_get(return_type)
281
+ klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
282
+ end
283
+ end
284
+
285
+ # Sanitize filename by removing path.
286
+ # e.g. ../../sun.gif becomes sun.gif
287
+ #
288
+ # @param [String] filename the filename to be sanitized
289
+ # @return [String] the sanitized filename
290
+ def sanitize_filename(filename)
291
+ filename.gsub(/.*[\/\\]/, '')
292
+ end
293
+
294
+ def build_request_url(path, opts = {})
295
+ # Add leading and trailing slashes to path
296
+ path = "/#{path}".gsub(/\/+/, '/')
297
+ @config.base_url(opts[:operation]) + path
298
+ end
299
+
300
+ # Update header and query params based on authentication settings.
301
+ #
302
+ # @param [Hash] header_params Header parameters
303
+ # @param [Hash] query_params Query parameters
304
+ # @param [String] auth_names Authentication scheme name
305
+ def update_params_for_auth!(header_params, query_params, auth_names)
306
+ Array(auth_names).each do |auth_name|
307
+ auth_setting = @config.auth_settings[auth_name]
308
+ next unless auth_setting
309
+ case auth_setting[:in]
310
+ when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
311
+ when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
312
+ else fail ArgumentError, 'Authentication token must be in `query` or `header`'
313
+ end
314
+ end
315
+ end
316
+
317
+ # Sets user agent in HTTP header
318
+ #
319
+ # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
320
+ def user_agent=(user_agent)
321
+ @user_agent = user_agent
322
+ @default_headers['User-Agent'] = @user_agent
323
+ end
324
+
325
+ # Return Accept header based on an array of accepts provided.
326
+ # @param [Array] accepts array for Accept
327
+ # @return [String] the Accept header (e.g. application/json)
328
+ def select_header_accept(accepts)
329
+ return nil if accepts.nil? || accepts.empty?
330
+ # use JSON when present, otherwise use all of the provided
331
+ json_accept = accepts.find { |s| json_mime?(s) }
332
+ json_accept || accepts.join(',')
333
+ end
334
+
335
+ # Return Content-Type header based on an array of content types provided.
336
+ # @param [Array] content_types array for Content-Type
337
+ # @return [String] the Content-Type header (e.g. application/json)
338
+ def select_header_content_type(content_types)
339
+ # return nil by default
340
+ return if content_types.nil? || content_types.empty?
341
+ # use JSON when present, otherwise use the first one
342
+ json_content_type = content_types.find { |s| json_mime?(s) }
343
+ json_content_type || content_types.first
344
+ end
345
+
346
+ # Convert object (array, hash, object, etc) to JSON string.
347
+ # @param [Object] model object to be converted into JSON string
348
+ # @return [String] JSON string representation of the object
349
+ def object_to_http_body(model)
350
+ return model if model.nil? || model.is_a?(String)
351
+ local_body = nil
352
+ if model.is_a?(Array)
353
+ local_body = model.map { |m| object_to_hash(m) }
354
+ else
355
+ local_body = object_to_hash(model)
356
+ end
357
+ local_body.to_json
358
+ end
359
+
360
+ # Convert object(non-array) to hash.
361
+ # @param [Object] obj object to be converted into JSON string
362
+ # @return [String] JSON string representation of the object
363
+ def object_to_hash(obj)
364
+ if obj.respond_to?(:to_hash)
365
+ obj.to_hash
366
+ else
367
+ obj
368
+ end
369
+ end
370
+
371
+ # Build parameter value according to the given collection format.
372
+ # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
373
+ def build_collection_param(param, collection_format)
374
+ case collection_format
375
+ when :csv
376
+ param.join(',')
377
+ when :ssv
378
+ param.join(' ')
379
+ when :tsv
380
+ param.join("\t")
381
+ when :pipes
382
+ param.join('|')
383
+ when :multi
384
+ # return the array directly as typhoeus will handle it as expected
385
+ param
386
+ else
387
+ fail "unknown collection format: #{collection_format.inspect}"
388
+ end
389
+ end
390
+ end
391
+ end
@@ -0,0 +1,57 @@
1
+ =begin
2
+ #OneLogin API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 3.0.0-alpha.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1
10
+
11
+ =end
12
+
13
+ module OneLogin
14
+ class ApiError < StandardError
15
+ attr_reader :code, :response_headers, :response_body
16
+
17
+ # Usage examples:
18
+ # ApiError.new
19
+ # ApiError.new("message")
20
+ # ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
21
+ # ApiError.new(:code => 404, :message => "Not Found")
22
+ def initialize(arg = nil)
23
+ if arg.is_a? Hash
24
+ if arg.key?(:message) || arg.key?('message')
25
+ super(arg[:message] || arg['message'])
26
+ else
27
+ super arg
28
+ end
29
+
30
+ arg.each do |k, v|
31
+ instance_variable_set "@#{k}", v
32
+ end
33
+ else
34
+ super arg
35
+ end
36
+ end
37
+
38
+ # Override to_s to display a friendly error message
39
+ def to_s
40
+ message
41
+ end
42
+
43
+ def message
44
+ if @message.nil?
45
+ msg = "Error message: the server returns an error"
46
+ else
47
+ msg = @message
48
+ end
49
+
50
+ msg += "\nHTTP status code: #{code}" if code
51
+ msg += "\nResponse headers: #{response_headers}" if response_headers
52
+ msg += "\nResponse body: #{response_body}" if response_body
53
+
54
+ msg
55
+ end
56
+ end
57
+ end