onelogin 1.6.0 → 3.0.0.pre.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +7 -4
- data/README.md +245 -484
- data/Rakefile +7 -3
- data/docs/Action.md +26 -0
- data/docs/ActivateFactorRequest.md +24 -0
- data/docs/AddAccessTokenClaimRequest.md +22 -0
- data/docs/AddClientAppRequest.md +20 -0
- data/docs/AddRoleUsers200ResponseInner.md +18 -0
- data/docs/AddScopeRequest.md +20 -0
- data/docs/AuthMethod.md +15 -0
- data/docs/AuthServerConfiguration.md +24 -0
- data/docs/ClientApp.md +20 -0
- data/docs/Condition.md +22 -0
- data/docs/Connector.md +26 -0
- data/docs/CreateAuthorizationServerRequest.md +22 -0
- data/docs/CreateEnvironmentVariableRequest.md +20 -0
- data/docs/CreateRoles201ResponseInner.md +18 -0
- data/docs/DefaultApi.md +6812 -0
- data/docs/Device.md +26 -0
- data/docs/EnrollFactorRequest.md +28 -0
- data/docs/Envvar.md +24 -0
- data/docs/ErrorStatus.md +22 -0
- data/docs/ErrorStatusErrorsInner.md +20 -0
- data/docs/FactorInner.md +32 -0
- data/docs/FactorInnerFactorData.md +20 -0
- data/docs/GenerateMfaToken200Response.md +24 -0
- data/docs/GenerateMfaToken422Response.md +24 -0
- data/docs/GenerateMfaToken422ResponseDetails.md +18 -0
- data/docs/GenerateMfaTokenRequest.md +20 -0
- data/docs/GenerateSamlAssertionRequest.md +26 -0
- data/docs/GenerateToken200Response.md +28 -0
- data/docs/GenerateToken400Response.md +18 -0
- data/docs/GenerateTokenRequest.md +18 -0
- data/docs/GetAuthorizationServer200Response.md +24 -0
- data/docs/GetAvailableFactors200ResponseInner.md +22 -0
- data/docs/GetClientApps200ResponseInner.md +24 -0
- data/docs/GetClientApps200ResponseInnerScopesInner.md +22 -0
- data/docs/GetRateLimit200Response.md +20 -0
- data/docs/GetRateLimit200ResponseData.md +22 -0
- data/docs/GetRiskScore200Response.md +20 -0
- data/docs/GetRiskScore400Response.md +18 -0
- data/docs/GetRiskScoreRequest.md +30 -0
- data/docs/GetScoreInsights200Response.md +20 -0
- data/docs/GetScoreInsights200ResponseScores.md +26 -0
- data/docs/GetUserApps200ResponseInner.md +32 -0
- data/docs/Hook.md +46 -0
- data/docs/HookConditionsInner.md +22 -0
- data/docs/HookOptions.md +22 -0
- data/docs/HookStatus.md +20 -0
- data/docs/Id.md +18 -0
- data/docs/ListAccessTokenClaims200ResponseInner.md +34 -0
- data/docs/ListActions200ResponseInner.md +20 -0
- data/docs/ListAppUsers200ResponseInner.md +26 -0
- data/docs/ListAuthorizationServers200ResponseInner.md +24 -0
- data/docs/ListAuthorizationServers200ResponseInnerConfiguration.md +20 -0
- data/docs/ListConditionOperators200ResponseInner.md +20 -0
- data/docs/ListConditionValues200ResponseInner.md +20 -0
- data/docs/ListConditions200ResponseInner.md +20 -0
- data/docs/ListMappingConditionOperators200ResponseInner.md +20 -0
- data/docs/ListMappingConditions200ResponseInner.md +20 -0
- data/docs/ListScopes200ResponseInner.md +22 -0
- data/docs/Log.md +24 -0
- data/docs/Mapping.md +30 -0
- data/docs/Registration.md +22 -0
- data/docs/RemoveRoleUsersRequest.md +18 -0
- data/docs/RevokeTokenRequest.md +18 -0
- data/docs/RiskDevice.md +18 -0
- data/docs/RiskRule.md +30 -0
- data/docs/RiskUser.md +22 -0
- data/docs/Role.md +26 -0
- data/docs/Rule.md +30 -0
- data/docs/RuleId.md +18 -0
- data/docs/Schema.md +56 -0
- data/docs/Schema1.md +28 -0
- data/docs/Schema1AddedBy.md +20 -0
- data/docs/SchemaProvisioning.md +18 -0
- data/docs/Session.md +18 -0
- data/docs/SetRoleApps200ResponseInner.md +18 -0
- data/docs/Source.md +20 -0
- data/docs/Status.md +24 -0
- data/docs/Status1.md +22 -0
- data/docs/Status2.md +18 -0
- data/docs/Status2Status.md +24 -0
- data/docs/TrackEventRequest.md +34 -0
- data/docs/UpdateAuthorizationServer400Response.md +24 -0
- data/docs/UpdateClientAppRequest.md +18 -0
- data/docs/UpdateEnvironmentVariableRequest.md +18 -0
- data/docs/UpdateRole200Response.md +18 -0
- data/docs/User.md +90 -0
- data/docs/VerifyEnrollmentRequest.md +18 -0
- data/docs/VerifyFactorRequest.md +20 -0
- data/docs/VerifyFactorSaml200Response.md +20 -0
- data/docs/VerifyFactorSamlRequest.md +26 -0
- data/docs/VerifyFactorVoice200ResponseInner.md +22 -0
- data/git_push.sh +57 -0
- data/lib/onelogin/api/default_api.rb +7334 -0
- data/lib/onelogin/api_client.rb +391 -0
- data/lib/onelogin/api_error.rb +57 -0
- data/lib/onelogin/configuration.rb +282 -0
- data/lib/onelogin/models/action.rb +262 -0
- data/lib/onelogin/models/activate_factor_request.rb +250 -0
- data/lib/onelogin/models/add_access_token_claim_request.rb +237 -0
- data/lib/onelogin/models/add_client_app_request.rb +230 -0
- data/lib/onelogin/models/add_role_users200_response_inner.rb +219 -0
- data/lib/onelogin/models/add_scope_request.rb +228 -0
- data/lib/onelogin/models/auth_method.rb +43 -0
- data/lib/onelogin/models/auth_server_configuration.rb +248 -0
- data/lib/onelogin/models/client_app.rb +228 -0
- data/lib/onelogin/models/condition.rb +240 -0
- data/lib/onelogin/models/connector.rb +259 -0
- data/lib/onelogin/models/create_authorization_server_request.rb +237 -0
- data/lib/onelogin/models/create_environment_variable_request.rb +240 -0
- data/lib/onelogin/models/create_roles201_response_inner.rb +219 -0
- data/lib/onelogin/models/device.rb +255 -0
- data/lib/onelogin/models/enroll_factor_request.rb +280 -0
- data/lib/onelogin/models/envvar.rb +250 -0
- data/lib/onelogin/models/error_status.rb +239 -0
- data/lib/onelogin/models/error_status_errors_inner.rb +230 -0
- data/lib/onelogin/models/factor_inner.rb +323 -0
- data/lib/onelogin/models/factor_inner_factor_data.rb +231 -0
- data/lib/onelogin/models/generate_mfa_token200_response.rb +250 -0
- data/lib/onelogin/models/generate_mfa_token422_response.rb +246 -0
- data/lib/onelogin/models/generate_mfa_token422_response_details.rb +221 -0
- data/lib/onelogin/models/generate_mfa_token_request.rb +230 -0
- data/lib/onelogin/models/generate_saml_assertion_request.rb +280 -0
- data/lib/onelogin/models/generate_token200_response.rb +264 -0
- data/lib/onelogin/models/generate_token400_response.rb +219 -0
- data/lib/onelogin/models/generate_token_request.rb +253 -0
- data/lib/onelogin/models/get_authorization_server200_response.rb +246 -0
- data/lib/onelogin/models/get_available_factors200_response_inner.rb +240 -0
- data/lib/onelogin/models/get_client_apps200_response_inner.rb +248 -0
- data/lib/onelogin/models/get_client_apps200_response_inner_scopes_inner.rb +237 -0
- data/lib/onelogin/models/get_rate_limit200_response.rb +228 -0
- data/lib/onelogin/models/get_rate_limit200_response_data.rb +237 -0
- data/lib/onelogin/models/get_risk_score200_response.rb +256 -0
- data/lib/onelogin/models/get_risk_score400_response.rb +221 -0
- data/lib/onelogin/models/get_risk_score_request.rb +291 -0
- data/lib/onelogin/models/get_score_insights200_response.rb +228 -0
- data/lib/onelogin/models/get_score_insights200_response_scores.rb +255 -0
- data/lib/onelogin/models/get_user_apps200_response_inner.rb +335 -0
- data/lib/onelogin/models/hook.rb +462 -0
- data/lib/onelogin/models/hook_conditions_inner.rb +237 -0
- data/lib/onelogin/models/hook_options.rb +238 -0
- data/lib/onelogin/models/hook_status.rb +228 -0
- data/lib/onelogin/models/id.rb +219 -0
- data/lib/onelogin/models/list_access_token_claims200_response_inner.rb +293 -0
- data/lib/onelogin/models/list_actions200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_app_users200_response_inner.rb +255 -0
- data/lib/onelogin/models/list_authorization_servers200_response_inner.rb +246 -0
- data/lib/onelogin/models/list_authorization_servers200_response_inner_configuration.rb +230 -0
- data/lib/onelogin/models/list_condition_operators200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_condition_values200_response_inner.rb +228 -0
- data/lib/onelogin/models/list_conditions200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_mapping_condition_operators200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_mapping_conditions200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_scopes200_response_inner.rb +237 -0
- data/lib/onelogin/models/log.rb +248 -0
- data/lib/onelogin/models/mapping.rb +342 -0
- data/lib/onelogin/models/registration.rb +274 -0
- data/lib/onelogin/models/remove_role_users_request.rb +221 -0
- data/lib/onelogin/models/revoke_token_request.rb +219 -0
- data/lib/onelogin/models/risk_device.rb +221 -0
- data/lib/onelogin/models/risk_rule.rb +325 -0
- data/lib/onelogin/models/risk_user.rb +248 -0
- data/lib/onelogin/models/role.rb +266 -0
- data/lib/onelogin/models/rule.rb +317 -0
- data/lib/onelogin/models/rule_id.rb +219 -0
- data/lib/onelogin/models/schema.rb +441 -0
- data/lib/onelogin/models/schema1.rb +265 -0
- data/lib/onelogin/models/schema1_added_by.rb +228 -0
- data/lib/onelogin/models/schema_provisioning.rb +220 -0
- data/lib/onelogin/models/session.rb +221 -0
- data/lib/onelogin/models/set_role_apps200_response_inner.rb +220 -0
- data/lib/onelogin/models/source.rb +230 -0
- data/lib/onelogin/models/status.rb +246 -0
- data/lib/onelogin/models/status1.rb +237 -0
- data/lib/onelogin/models/status2.rb +219 -0
- data/lib/onelogin/models/status2_status.rb +246 -0
- data/lib/onelogin/models/track_event_request.rb +316 -0
- data/lib/onelogin/models/update_authorization_server400_response.rb +246 -0
- data/lib/onelogin/models/update_client_app_request.rb +221 -0
- data/lib/onelogin/models/update_environment_variable_request.rb +225 -0
- data/lib/onelogin/models/update_role200_response.rb +219 -0
- data/lib/onelogin/models/user.rb +615 -0
- data/lib/onelogin/models/verify_enrollment_request.rb +219 -0
- data/lib/onelogin/models/verify_factor_request.rb +230 -0
- data/lib/onelogin/models/verify_factor_saml200_response.rb +230 -0
- data/lib/onelogin/models/verify_factor_saml_request.rb +275 -0
- data/lib/onelogin/models/verify_factor_voice200_response_inner.rb +271 -0
- data/lib/onelogin/version.rb +13 -1
- data/lib/onelogin.rb +130 -1
- data/onelogin.gemspec +35 -42
- data/spec/api/default_api_spec.rb +1259 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/action_spec.rb +58 -0
- data/spec/models/activate_factor_request_spec.rb +52 -0
- data/spec/models/add_access_token_claim_request_spec.rb +46 -0
- data/spec/models/add_client_app_request_spec.rb +40 -0
- data/spec/models/add_role_users200_response_inner_spec.rb +34 -0
- data/spec/models/add_scope_request_spec.rb +40 -0
- data/spec/models/auth_method_spec.rb +28 -0
- data/spec/models/auth_server_configuration_spec.rb +52 -0
- data/spec/models/client_app_spec.rb +40 -0
- data/spec/models/condition_spec.rb +46 -0
- data/spec/models/connector_spec.rb +58 -0
- data/spec/models/create_authorization_server_request_spec.rb +46 -0
- data/spec/models/create_environment_variable_request_spec.rb +40 -0
- data/spec/models/create_roles201_response_inner_spec.rb +34 -0
- data/spec/models/device_spec.rb +58 -0
- data/spec/models/enroll_factor_request_spec.rb +64 -0
- data/spec/models/envvar_spec.rb +52 -0
- data/spec/models/error_status_errors_inner_spec.rb +40 -0
- data/spec/models/error_status_spec.rb +46 -0
- data/spec/models/factor_inner_factor_data_spec.rb +40 -0
- data/spec/models/factor_inner_spec.rb +80 -0
- data/spec/models/generate_mfa_token200_response_spec.rb +52 -0
- data/spec/models/generate_mfa_token422_response_details_spec.rb +34 -0
- data/spec/models/generate_mfa_token422_response_spec.rb +52 -0
- data/spec/models/generate_mfa_token_request_spec.rb +40 -0
- data/spec/models/generate_saml_assertion_request_spec.rb +58 -0
- data/spec/models/generate_token200_response_spec.rb +64 -0
- data/spec/models/generate_token400_response_spec.rb +34 -0
- data/spec/models/generate_token_request_spec.rb +38 -0
- data/spec/models/get_authorization_server200_response_spec.rb +52 -0
- data/spec/models/get_available_factors200_response_inner_spec.rb +46 -0
- data/spec/models/get_client_apps200_response_inner_scopes_inner_spec.rb +46 -0
- data/spec/models/get_client_apps200_response_inner_spec.rb +52 -0
- data/spec/models/get_rate_limit200_response_data_spec.rb +46 -0
- data/spec/models/get_rate_limit200_response_spec.rb +40 -0
- data/spec/models/get_risk_score200_response_spec.rb +40 -0
- data/spec/models/get_risk_score400_response_spec.rb +34 -0
- data/spec/models/get_risk_score_request_spec.rb +70 -0
- data/spec/models/get_score_insights200_response_scores_spec.rb +58 -0
- data/spec/models/get_score_insights200_response_spec.rb +40 -0
- data/spec/models/get_user_apps200_response_inner_spec.rb +84 -0
- data/spec/models/hook_conditions_inner_spec.rb +46 -0
- data/spec/models/hook_options_spec.rb +46 -0
- data/spec/models/hook_spec.rb +122 -0
- data/spec/models/hook_status_spec.rb +40 -0
- data/spec/models/id_spec.rb +34 -0
- data/spec/models/list_access_token_claims200_response_inner_spec.rb +82 -0
- data/spec/models/list_actions200_response_inner_spec.rb +40 -0
- data/spec/models/list_app_users200_response_inner_spec.rb +58 -0
- data/spec/models/list_authorization_servers200_response_inner_configuration_spec.rb +40 -0
- data/spec/models/list_authorization_servers200_response_inner_spec.rb +52 -0
- data/spec/models/list_condition_operators200_response_inner_spec.rb +40 -0
- data/spec/models/list_condition_values200_response_inner_spec.rb +40 -0
- data/spec/models/list_conditions200_response_inner_spec.rb +40 -0
- data/spec/models/list_mapping_condition_operators200_response_inner_spec.rb +40 -0
- data/spec/models/list_mapping_conditions200_response_inner_spec.rb +40 -0
- data/spec/models/list_scopes200_response_inner_spec.rb +46 -0
- data/spec/models/log_spec.rb +52 -0
- data/spec/models/mapping_spec.rb +74 -0
- data/spec/models/registration_spec.rb +50 -0
- data/spec/models/remove_role_users_request_spec.rb +34 -0
- data/spec/models/revoke_token_request_spec.rb +34 -0
- data/spec/models/risk_device_spec.rb +34 -0
- data/spec/models/risk_rule_spec.rb +78 -0
- data/spec/models/risk_user_spec.rb +46 -0
- data/spec/models/role_spec.rb +58 -0
- data/spec/models/rule_id_spec.rb +34 -0
- data/spec/models/rule_spec.rb +74 -0
- data/spec/models/schema1_added_by_spec.rb +40 -0
- data/spec/models/schema1_spec.rb +64 -0
- data/spec/models/schema_provisioning_spec.rb +34 -0
- data/spec/models/schema_spec.rb +152 -0
- data/spec/models/session_spec.rb +34 -0
- data/spec/models/set_role_apps200_response_inner_spec.rb +34 -0
- data/spec/models/source_spec.rb +40 -0
- data/spec/models/status1_spec.rb +46 -0
- data/spec/models/status2_spec.rb +34 -0
- data/spec/models/status2_status_spec.rb +52 -0
- data/spec/models/status_spec.rb +52 -0
- data/spec/models/track_event_request_spec.rb +82 -0
- data/spec/models/update_authorization_server400_response_spec.rb +52 -0
- data/spec/models/update_client_app_request_spec.rb +34 -0
- data/spec/models/update_environment_variable_request_spec.rb +34 -0
- data/spec/models/update_role200_response_spec.rb +34 -0
- data/spec/models/user_spec.rb +258 -0
- data/spec/models/verify_enrollment_request_spec.rb +34 -0
- data/spec/models/verify_factor_request_spec.rb +40 -0
- data/spec/models/verify_factor_saml200_response_spec.rb +40 -0
- data/spec/models/verify_factor_saml_request_spec.rb +58 -0
- data/spec/models/verify_factor_voice200_response_inner_spec.rb +50 -0
- data/spec/spec_helper.rb +111 -0
- metadata +401 -216
- data/.github/workflows/git-secrets-public.yml +0 -55
- data/.gitignore +0 -12
- data/.travis.yml +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -6
- data/examples/Gemfile +0 -3
- data/examples/Gemfile.lock +0 -25
- data/examples/README.md +0 -19
- data/examples/all-users-to-csv.rb +0 -48
- data/examples/another-get-all-login-events-of-last-day-to-csv.rb +0 -141
- data/examples/create-user.rb +0 -16
- data/examples/events-to-csv.rb +0 -93
- data/examples/get-all-login-events-of-last-day-to-csv.rb +0 -88
- data/examples/last-app-user-login-to-csv.rb +0 -72
- data/examples/list-users.rb +0 -15
- data/examples/rails-custom-login-page/.gitignore +0 -45
- data/examples/rails-custom-login-page/.ruby-version +0 -1
- data/examples/rails-custom-login-page/Gemfile +0 -57
- data/examples/rails-custom-login-page/Gemfile.lock +0 -212
- data/examples/rails-custom-login-page/README.md +0 -137
- data/examples/rails-custom-login-page/Rakefile +0 -6
- data/examples/rails-custom-login-page/app/assets/config/manifest.js +0 -3
- data/examples/rails-custom-login-page/app/assets/images/.keep +0 -0
- data/examples/rails-custom-login-page/app/assets/javascripts/application.js +0 -18
- data/examples/rails-custom-login-page/app/assets/javascripts/cable.js +0 -13
- data/examples/rails-custom-login-page/app/assets/javascripts/channels/.keep +0 -0
- data/examples/rails-custom-login-page/app/assets/javascripts/dashboard.coffee +0 -3
- data/examples/rails-custom-login-page/app/assets/javascripts/home.coffee +0 -3
- data/examples/rails-custom-login-page/app/assets/javascripts/sessions.coffee +0 -3
- data/examples/rails-custom-login-page/app/assets/stylesheets/application.css +0 -15
- data/examples/rails-custom-login-page/app/assets/stylesheets/dashboard.scss +0 -3
- data/examples/rails-custom-login-page/app/assets/stylesheets/home.scss +0 -3
- data/examples/rails-custom-login-page/app/assets/stylesheets/sessions.scss +0 -3
- data/examples/rails-custom-login-page/app/channels/application_cable/channel.rb +0 -4
- data/examples/rails-custom-login-page/app/channels/application_cable/connection.rb +0 -4
- data/examples/rails-custom-login-page/app/controllers/application_controller.rb +0 -23
- data/examples/rails-custom-login-page/app/controllers/concerns/.keep +0 -0
- data/examples/rails-custom-login-page/app/controllers/dashboard_controller.rb +0 -10
- data/examples/rails-custom-login-page/app/controllers/home_controller.rb +0 -5
- data/examples/rails-custom-login-page/app/controllers/sessions_controller.rb +0 -46
- data/examples/rails-custom-login-page/app/controllers/users_controller.rb +0 -120
- data/examples/rails-custom-login-page/app/helpers/application_helper.rb +0 -2
- data/examples/rails-custom-login-page/app/helpers/dashboard_helper.rb +0 -28
- data/examples/rails-custom-login-page/app/helpers/home_helper.rb +0 -2
- data/examples/rails-custom-login-page/app/helpers/sessions_helper.rb +0 -87
- data/examples/rails-custom-login-page/app/helpers/users_helper.rb +0 -3
- data/examples/rails-custom-login-page/app/jobs/application_job.rb +0 -2
- data/examples/rails-custom-login-page/app/mailers/application_mailer.rb +0 -4
- data/examples/rails-custom-login-page/app/models/application_record.rb +0 -3
- data/examples/rails-custom-login-page/app/models/concerns/.keep +0 -0
- data/examples/rails-custom-login-page/app/views/dashboard/index.html.erb +0 -43
- data/examples/rails-custom-login-page/app/views/home/index.html.erb +0 -272
- data/examples/rails-custom-login-page/app/views/layouts/application.html.erb +0 -31
- data/examples/rails-custom-login-page/app/views/layouts/mailer.html.erb +0 -13
- data/examples/rails-custom-login-page/app/views/layouts/mailer.text.erb +0 -1
- data/examples/rails-custom-login-page/app/views/users/_form.html.erb +0 -1
- data/examples/rails-custom-login-page/app/views/users/_user.json.jbuilder +0 -2
- data/examples/rails-custom-login-page/app/views/users/edit.html.erb +0 -33
- data/examples/rails-custom-login-page/app/views/users/index.html.erb +0 -33
- data/examples/rails-custom-login-page/app/views/users/index.json.jbuilder +0 -1
- data/examples/rails-custom-login-page/app/views/users/new.html.erb +0 -60
- data/examples/rails-custom-login-page/app/views/users/onboard.html.erb +0 -54
- data/examples/rails-custom-login-page/app/views/users/show.html.erb +0 -17
- data/examples/rails-custom-login-page/app/views/users/show.json.jbuilder +0 -1
- data/examples/rails-custom-login-page/bin/bundle +0 -3
- data/examples/rails-custom-login-page/bin/rails +0 -9
- data/examples/rails-custom-login-page/bin/rake +0 -9
- data/examples/rails-custom-login-page/bin/setup +0 -38
- data/examples/rails-custom-login-page/bin/spring +0 -17
- data/examples/rails-custom-login-page/bin/update +0 -29
- data/examples/rails-custom-login-page/bin/yarn +0 -11
- data/examples/rails-custom-login-page/config/application.rb +0 -18
- data/examples/rails-custom-login-page/config/boot.rb +0 -3
- data/examples/rails-custom-login-page/config/cable.yml +0 -10
- data/examples/rails-custom-login-page/config/database.yml +0 -25
- data/examples/rails-custom-login-page/config/environment.rb +0 -5
- data/examples/rails-custom-login-page/config/environments/development.rb +0 -54
- data/examples/rails-custom-login-page/config/environments/production.rb +0 -91
- data/examples/rails-custom-login-page/config/environments/test.rb +0 -42
- data/examples/rails-custom-login-page/config/initializers/application_controller_renderer.rb +0 -8
- data/examples/rails-custom-login-page/config/initializers/assets.rb +0 -14
- data/examples/rails-custom-login-page/config/initializers/backtrace_silencers.rb +0 -7
- data/examples/rails-custom-login-page/config/initializers/cookies_serializer.rb +0 -5
- data/examples/rails-custom-login-page/config/initializers/filter_parameter_logging.rb +0 -4
- data/examples/rails-custom-login-page/config/initializers/inflections.rb +0 -16
- data/examples/rails-custom-login-page/config/initializers/mime_types.rb +0 -4
- data/examples/rails-custom-login-page/config/initializers/onelogin.rb +0 -6
- data/examples/rails-custom-login-page/config/initializers/wrap_parameters.rb +0 -14
- data/examples/rails-custom-login-page/config/locales/en.yml +0 -33
- data/examples/rails-custom-login-page/config/puma.rb +0 -56
- data/examples/rails-custom-login-page/config/routes.rb +0 -23
- data/examples/rails-custom-login-page/config/secrets.yml.sample +0 -38
- data/examples/rails-custom-login-page/config/spring.rb +0 -6
- data/examples/rails-custom-login-page/config.ru +0 -5
- data/examples/rails-custom-login-page/db/seeds.rb +0 -7
- data/examples/rails-custom-login-page/lib/assets/.keep +0 -0
- data/examples/rails-custom-login-page/lib/tasks/.keep +0 -0
- data/examples/rails-custom-login-page/package.json +0 -5
- data/examples/rails-custom-login-page/public/404.html +0 -67
- data/examples/rails-custom-login-page/public/422.html +0 -67
- data/examples/rails-custom-login-page/public/500.html +0 -66
- data/examples/rails-custom-login-page/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/rails-custom-login-page/public/apple-touch-icon.png +0 -0
- data/examples/rails-custom-login-page/public/favicon.ico +0 -0
- data/examples/rails-custom-login-page/public/robots.txt +0 -1
- data/examples/rails-custom-login-page/test/application_system_test_case.rb +0 -5
- data/examples/rails-custom-login-page/test/controllers/.keep +0 -0
- data/examples/rails-custom-login-page/test/controllers/dashboard_controller_test.rb +0 -9
- data/examples/rails-custom-login-page/test/controllers/home_controller_test.rb +0 -9
- data/examples/rails-custom-login-page/test/controllers/sessions_controller_test.rb +0 -7
- data/examples/rails-custom-login-page/test/controllers/users_controller_test.rb +0 -48
- data/examples/rails-custom-login-page/test/fixtures/.keep +0 -0
- data/examples/rails-custom-login-page/test/fixtures/files/.keep +0 -0
- data/examples/rails-custom-login-page/test/helpers/.keep +0 -0
- data/examples/rails-custom-login-page/test/integration/.keep +0 -0
- data/examples/rails-custom-login-page/test/mailers/.keep +0 -0
- data/examples/rails-custom-login-page/test/models/.keep +0 -0
- data/examples/rails-custom-login-page/test/system/.keep +0 -0
- data/examples/rails-custom-login-page/test/test_helper.rb +0 -9
- data/examples/rails-custom-login-page/vendor/.keep +0 -0
- data/lib/onelogin/api/apiexception.rb +0 -10
- data/lib/onelogin/api/client.rb +0 -2954
- data/lib/onelogin/api/cursor.rb +0 -114
- data/lib/onelogin/api/models/app.rb +0 -22
- data/lib/onelogin/api/models/auth_factor.rb +0 -16
- data/lib/onelogin/api/models/connector_basic.rb +0 -20
- data/lib/onelogin/api/models/device.rb +0 -18
- data/lib/onelogin/api/models/embed_app.rb +0 -31
- data/lib/onelogin/api/models/event.rb +0 -54
- data/lib/onelogin/api/models/event_type.rb +0 -17
- data/lib/onelogin/api/models/factor_enrollment_response.rb +0 -22
- data/lib/onelogin/api/models/group.rb +0 -17
- data/lib/onelogin/api/models/mfa.rb +0 -26
- data/lib/onelogin/api/models/mfa_token.rb +0 -18
- data/lib/onelogin/api/models/onelogin_app.rb +0 -62
- data/lib/onelogin/api/models/onelogin_app_basic.rb +0 -51
- data/lib/onelogin/api/models/onelogin_app_v1.rb +0 -22
- data/lib/onelogin/api/models/onelogin_token.rb +0 -20
- data/lib/onelogin/api/models/otp_device.rb +0 -25
- data/lib/onelogin/api/models/privilege.rb +0 -51
- data/lib/onelogin/api/models/rate_limit.rb +0 -17
- data/lib/onelogin/api/models/role.rb +0 -16
- data/lib/onelogin/api/models/saml_endpoint_response.rb +0 -18
- data/lib/onelogin/api/models/session_token_info.rb +0 -21
- data/lib/onelogin/api/models/session_token_mfa_info.rb +0 -26
- data/lib/onelogin/api/models/statement.rb +0 -36
- data/lib/onelogin/api/models/user.rb +0 -135
- data/lib/onelogin/api/models/user_data.rb +0 -13
- data/lib/onelogin/api/models/user_metadata.rb +0 -13
- data/lib/onelogin/api/models.rb +0 -26
- data/lib/onelogin/api/util/constants.rb +0 -177
- data/lib/onelogin/api/util/parser.rb +0 -56
- data/lib/onelogin/api/util/url_builder.rb +0 -24
- data/lib/onelogin/api/util.rb +0 -13
- data/lib/onelogin/api.rb +0 -2
@@ -1,55 +0,0 @@
|
|
1
|
-
name: git-secrets
|
2
|
-
|
3
|
-
on: [push,pull_request]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
build:
|
7
|
-
runs-on: ubuntu-latest
|
8
|
-
|
9
|
-
steps:
|
10
|
-
- name: Checkout
|
11
|
-
uses: actions/checkout@v2
|
12
|
-
with:
|
13
|
-
path: source
|
14
|
-
|
15
|
-
- name: Install git-secrets
|
16
|
-
shell: bash
|
17
|
-
run: |
|
18
|
-
cd ..
|
19
|
-
echo 'cloning https://github.com/awslabs/git-secrets.git'
|
20
|
-
git clone https://github.com/awslabs/git-secrets.git
|
21
|
-
cd git-secrets
|
22
|
-
echo 'installing git-secrets'
|
23
|
-
sudo make install
|
24
|
-
- name: Add Rules
|
25
|
-
shell: bash
|
26
|
-
run: |
|
27
|
-
cd source
|
28
|
-
echo 'running git-secrets'
|
29
|
-
pwd
|
30
|
-
git secrets --add '[a-zA-Z]{3,10}://[^/\\s:@]{3,20}:[^/\\s:@]{3,20}@.{1,100}[\"~\\s]'
|
31
|
-
git secrets --add 'AIza[0-9A-Za-z\\-_]{35}'
|
32
|
-
git secrets --add 'LS0tLS1CRUdJTiBQR1AgUFJJVkFURSBLRVkgQkxPQ0stLS0tL[%a-zA-Z0-9+/]+={0,2}'
|
33
|
-
git secrets --add 'LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tL[%a-zA-Z0-9+/]+={0,2}'
|
34
|
-
git secrets --add 'LS0tLS1CRUdJTiBEU0EgUFJJVkFURSBLRVktLS0tL[%a-zA-Z0-9+/]+={0,2}'
|
35
|
-
git secrets --add 'LS0tLS1CRUdJTiBFQyBQUklWQVRFIEtFWS0tLS0t[%a-zA-Z0-9+/]+={0,2}'
|
36
|
-
git secrets --add 'LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS[%a-zA-Z0-9+/]+={0,2}'
|
37
|
-
git secrets --add '(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'
|
38
|
-
git secrets --add '[Tt][Ww][Ii][Tt][Tt][Ee][Rr][^/]{0,50}[0-9a-zA-Z]{35,44}'
|
39
|
-
git secrets --add '[Hh][Oo][Cc][Kk][Ee][Yy].{0,50}(\\\"|~|`)?[0-9a-f]{32}(\\\"|~|`)?'
|
40
|
-
git secrets --add '(QTNU|QUtJQ|QUdQQ|QUlEQ|QVJPQ|QUlQQ|QU5QQ|QU5WQ|QVNJQ)[%a-zA-Z0-9+/]{20,24}={0,2}'
|
41
|
-
git secrets --add 'ya29\\.[0-9A-Za-z\\-_]+'
|
42
|
-
git secrets --add 'https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}'
|
43
|
-
git secrets --add '[0-9a-f]{32}-us[0-9]{1,2}'
|
44
|
-
git secrets --add '[Ss][Aa][Uu][Cc][Ee].{0,50}(\\\"|~|`)?[0-9a-f-]{36}(\\\"|~|`)?'
|
45
|
-
git secrets --add '[Ff][Aa][Cc][Ee][Bb][Oo][Oo][Kk][^/]{0,50}(\\\"|~|`)?[0-9a-f]{32}(\\\"|~|`)?'
|
46
|
-
git secrets --add --allowed 'https:\/\/\#\{GITHUB_TOKEN\}:\#\{GITHUB_USERNAME\}@github.*'
|
47
|
-
git secrets --add --allowed 'AKIA[a-zA-Z0-9]{16}'
|
48
|
-
git secrets --add --allowed 'AIzaSyCi9HqVYImAgkqMCG0QmBUXAIfM5lyv_QU'
|
49
|
-
sed -i -e "s/~/'/g" .git/config
|
50
|
-
- name: Run Scan
|
51
|
-
shell: bash
|
52
|
-
run: |
|
53
|
-
cd source
|
54
|
-
git secrets --scan
|
55
|
-
echo 'Secrets found in this repo? You can install git-secrets locally to catch these issues pre-commit : https://github.com/awslabs/git-secrets'
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "onelogin"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/examples/Gemfile
DELETED
data/examples/Gemfile.lock
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
httparty (0.18.0)
|
5
|
-
mime-types (~> 3.0)
|
6
|
-
multi_xml (>= 0.5.2)
|
7
|
-
mime-types (3.3.1)
|
8
|
-
mime-types-data (~> 3.2015)
|
9
|
-
mime-types-data (3.2020.0425)
|
10
|
-
mini_portile2 (2.4.0)
|
11
|
-
multi_xml (0.6.0)
|
12
|
-
nokogiri (1.10.9)
|
13
|
-
mini_portile2 (~> 2.4.0)
|
14
|
-
onelogin (1.6.0)
|
15
|
-
httparty (>= 0.13.7)
|
16
|
-
nokogiri (>= 1.6.3.1)
|
17
|
-
|
18
|
-
PLATFORMS
|
19
|
-
ruby
|
20
|
-
|
21
|
-
DEPENDENCIES
|
22
|
-
onelogin
|
23
|
-
|
24
|
-
BUNDLED WITH
|
25
|
-
2.1.4
|
data/examples/README.md
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# Ruby SDK Examples
|
2
|
-
|
3
|
-
This folder contains various samples that make use of the OneLogin
|
4
|
-
Ruby SDK.
|
5
|
-
|
6
|
-
It assumes that you have a valid OneLogin `client_id` and `client_secret`
|
7
|
-
with the appropriate level of access for each example.
|
8
|
-
|
9
|
-
## Try the examples in terminal
|
10
|
-
|
11
|
-
First install the OneLogin gem and any other required gems
|
12
|
-
```shell
|
13
|
-
bundle install
|
14
|
-
```
|
15
|
-
|
16
|
-
Then update your API credentials in the example file and run it
|
17
|
-
```shell
|
18
|
-
ruby create-user.rb
|
19
|
-
```
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'onelogin'
|
2
|
-
|
3
|
-
#
|
4
|
-
# This example shows how you can export user details from OneLogin using the Ruby SDK
|
5
|
-
#
|
6
|
-
# Usage:
|
7
|
-
# 1. Set your own CLIENT_ID and CLIENT_SECRET below
|
8
|
-
# 2. From terminal run "ruby all-users-to-csv.rb" to extract all users including
|
9
|
-
# any custom attributes that might have been defined for the each user
|
10
|
-
#
|
11
|
-
|
12
|
-
client = OneLogin::Api::Client.new(
|
13
|
-
client_id: 'ONELOGIN_CLIENT_ID',
|
14
|
-
client_secret:'ONELOGIN_CLIENT_SECRET',
|
15
|
-
region: 'us',
|
16
|
-
max_results: 50000
|
17
|
-
)
|
18
|
-
|
19
|
-
attribute_names = ['id', 'external_id', 'email', 'username', 'firstname', 'lastname', 'distinguished_name',
|
20
|
-
'phone', 'company', 'department', 'status', 'member_of', 'samaccountname', 'userprincipalname',
|
21
|
-
'group_id', 'role_ids', 'custom_attributes', 'openid_name', 'locale_code', 'comment', 'directory_id',
|
22
|
-
'manager_ad_id', 'trusted_idp_id', 'activated_at', 'created_at', 'updated_at',
|
23
|
-
'password_changed_at', 'invitation_sent_at', 'invalid_login_attempts', 'last_login', 'locked_until']
|
24
|
-
|
25
|
-
custom_attribute_names = client.get_custom_attributes
|
26
|
-
|
27
|
-
CSV.open('users.csv', 'wb') do |csv|
|
28
|
-
# header row
|
29
|
-
csv << attribute_names + custom_attribute_names
|
30
|
-
|
31
|
-
client.get_users.each do |user|
|
32
|
-
|
33
|
-
row = []
|
34
|
-
|
35
|
-
# standard attributes
|
36
|
-
attribute_names.each do |attribute_name|
|
37
|
-
row << user.send(attribute_name)
|
38
|
-
end
|
39
|
-
|
40
|
-
# custom attributes
|
41
|
-
custom_attribute_names.each do |attribute_name|
|
42
|
-
row << user.custom_attributes[attribute_name] unless user.custom_attributes.empty?
|
43
|
-
end
|
44
|
-
|
45
|
-
csv << row
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
@@ -1,141 +0,0 @@
|
|
1
|
-
require 'onelogin'
|
2
|
-
|
3
|
-
client = OneLogin::Api::Client.new(
|
4
|
-
client_id: '9a19e9b07257c30ed3eddc0f9cf8d4127b4387646940acc8432c0dbcbd5f0c0d',
|
5
|
-
client_secret: 'd5cfcbe70b626f1d131f632c398b5b0d60dbc149b9ad9a55ac33715c7239acf7',
|
6
|
-
region: 'us',
|
7
|
-
max_results: 50000
|
8
|
-
)
|
9
|
-
|
10
|
-
client.access_token
|
11
|
-
|
12
|
-
unless client.error.nil?
|
13
|
-
puts "Error #{client.error} #{client.error_description}"
|
14
|
-
exit
|
15
|
-
end
|
16
|
-
|
17
|
-
|
18
|
-
user_attribute_names = ['id', 'username', 'email']
|
19
|
-
event_attribute_names = ['created_at', 'user_id', 'user_name', 'ipaddr', 'app_id', 'app_name']
|
20
|
-
csv_event_header = ['Timestamp', 'Description', 'Username', 'App', 'IP Address', 'User Id', 'Email', 'App Id']
|
21
|
-
|
22
|
-
user_options = {}
|
23
|
-
user_options[:fields] = user_attribute_names.join(",")
|
24
|
-
|
25
|
-
|
26
|
-
now = Date.today
|
27
|
-
days_ago = (now - 1)
|
28
|
-
event_options = {}
|
29
|
-
event_options[:since] = days_ago.strftime('%Y-%m-%dT%H:%M:%SZ')
|
30
|
-
event_options[:event_type_id] = 8;
|
31
|
-
event_options[:fields] = event_attribute_names.join(",")
|
32
|
-
event_options[:sort] = "-created_at"
|
33
|
-
|
34
|
-
now_str = Time.now.strftime("%Y-%m-%d_%H-%M-%S")
|
35
|
-
login_app_event_csv_name = now_str + '_login_app_events.csv'
|
36
|
-
login_event_csv_name = now_str + '_login_events.csv'
|
37
|
-
radius_event_csv_name = now_str + '_radius_events.csv'
|
38
|
-
|
39
|
-
users = {}
|
40
|
-
counter = 0
|
41
|
-
|
42
|
-
rate_limits = client.get_rate_limits
|
43
|
-
remaining_before = rate_limits.remaining
|
44
|
-
puts "Remaining RateLimit: #{remaining_before}"
|
45
|
-
|
46
|
-
puts "Extracting users from OneLogin"
|
47
|
-
|
48
|
-
client.get_users(user_options).each do |user|
|
49
|
-
users[user.id] = user
|
50
|
-
counter +=1
|
51
|
-
end
|
52
|
-
puts "#{counter} users extracted"
|
53
|
-
|
54
|
-
csv_login_app_event_header = ['Timestamp', 'Description', 'Username', 'App', 'IP Address', 'User Id', 'App Id', 'Email']
|
55
|
-
csv_login_event_header = ['Timestamp', 'Description', 'Username', 'IP Address', 'User Id', 'Email']
|
56
|
-
|
57
|
-
puts "Extracting login app events from OneLogin"
|
58
|
-
counter = 0
|
59
|
-
CSV.open(login_app_event_csv_name, 'wb') do |csv|
|
60
|
-
# header row
|
61
|
-
csv << csv_login_app_event_header
|
62
|
-
|
63
|
-
# fetch the events
|
64
|
-
client.get_events(event_options).each do |event|
|
65
|
-
username = email = ""
|
66
|
-
description = "#{event.user_name} signed into #{event.app_name}"
|
67
|
-
unless users.nil?
|
68
|
-
if users.has_key?(event.user_id)
|
69
|
-
username = users[event.user_id].username
|
70
|
-
email = users[event.user_id].email
|
71
|
-
end
|
72
|
-
end
|
73
|
-
csv << [event.created_at, description, username, event.app_name, event.ipaddr, event.user_id, event.app_id, email]
|
74
|
-
counter +=1
|
75
|
-
end
|
76
|
-
end
|
77
|
-
puts "Exported #{counter} login app events to #{login_app_event_csv_name}"
|
78
|
-
|
79
|
-
rate_limits = client.get_rate_limits
|
80
|
-
remaining_after = rate_limits.remaining
|
81
|
-
puts "Remaining RateLimit: #{remaining_after}"
|
82
|
-
|
83
|
-
|
84
|
-
event_options[:event_type_id] = 5;
|
85
|
-
puts "Extracting login events from OneLogin"
|
86
|
-
counter = 0
|
87
|
-
CSV.open(login_event_csv_name, 'wb') do |csv|
|
88
|
-
# header row
|
89
|
-
csv << csv_login_event_header
|
90
|
-
|
91
|
-
# fetch the events
|
92
|
-
client.get_events(event_options).each do |event|
|
93
|
-
username = email = ""
|
94
|
-
description = "#{event.user_name} logged into OneLogin"
|
95
|
-
unless users.nil?
|
96
|
-
if users.has_key?(event.user_id)
|
97
|
-
username = users[event.user_id].username
|
98
|
-
email = users[event.user_id].email
|
99
|
-
end
|
100
|
-
end
|
101
|
-
csv << [event.created_at, description, username, event.ipaddr, event.user_id, email]
|
102
|
-
counter +=1
|
103
|
-
end
|
104
|
-
end
|
105
|
-
puts "Exported #{counter} login events to #{login_event_csv_name}"
|
106
|
-
|
107
|
-
rate_limits = client.get_rate_limits
|
108
|
-
remaining_after = rate_limits.remaining
|
109
|
-
puts "Remaining RateLimit: #{remaining_after}"
|
110
|
-
|
111
|
-
|
112
|
-
event_options[:event_type_id] = 68;
|
113
|
-
puts "Extracting login radius events from OneLogin"
|
114
|
-
counter = 0
|
115
|
-
CSV.open(radius_event_csv_name, 'wb') do |csv|
|
116
|
-
# header row
|
117
|
-
csv << csv_login_event_header
|
118
|
-
|
119
|
-
# fetch the events
|
120
|
-
client.get_events(event_options).each do |event|
|
121
|
-
username = email = ""
|
122
|
-
description = "#{event.user_name} logged via Radius"
|
123
|
-
unless users.nil?
|
124
|
-
if users.has_key?(event.user_id)
|
125
|
-
username = users[event.user_id].username
|
126
|
-
email = users[event.user_id].email
|
127
|
-
end
|
128
|
-
end
|
129
|
-
csv << [event.created_at, description, username, event.ipaddr, event.user_id, email]
|
130
|
-
counter +=1
|
131
|
-
end
|
132
|
-
end
|
133
|
-
puts "Exported #{counter} radius events to #{radius_event_csv_name}"
|
134
|
-
|
135
|
-
rate_limits = client.get_rate_limits
|
136
|
-
remaining_after = rate_limits.remaining
|
137
|
-
puts "Remaining RateLimit: #{remaining_after}"
|
138
|
-
|
139
|
-
|
140
|
-
consumed = remaining_before - remaining_after
|
141
|
-
puts "The script consumed #{consumed} calls"
|
data/examples/create-user.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'onelogin'
|
2
|
-
|
3
|
-
client = OneLogin::Api::Client.new(
|
4
|
-
client_id: 'ONELOGIN_CLIENT_ID',
|
5
|
-
client_secret:'ONELOGIN_CLIENT_SECRET',
|
6
|
-
region: 'us'
|
7
|
-
)
|
8
|
-
|
9
|
-
user = client.create_user(
|
10
|
-
firstname: "Mick",
|
11
|
-
lastname: "Fanning",
|
12
|
-
email: "mick@onelogin.com",
|
13
|
-
username: "mick"
|
14
|
-
)
|
15
|
-
|
16
|
-
puts user
|
data/examples/events-to-csv.rb
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
require 'onelogin'
|
2
|
-
require 'optparse'
|
3
|
-
require 'optparse/time'
|
4
|
-
|
5
|
-
#
|
6
|
-
# This example shows how you can export events from OneLogin using the Ruby SDK
|
7
|
-
#
|
8
|
-
# Usage:
|
9
|
-
# 1. Set your own CLIENT_ID and CLIENT_SECRET below
|
10
|
-
# 2. From terminal run "ruby events-to-csv.rb" for the last 1000 events
|
11
|
-
# 3. Use the command line args to filter events
|
12
|
-
#
|
13
|
-
# e.g. "ruby events-to-csv.rb -t 5 -s 2018-01-01" for login events since Jan 1 2018
|
14
|
-
#
|
15
|
-
|
16
|
-
|
17
|
-
# Parse CLI arguments
|
18
|
-
options = {}
|
19
|
-
|
20
|
-
OptionParser.new do |opts|
|
21
|
-
opts.banner = "Usage: events-to-csv.rb [options]"
|
22
|
-
|
23
|
-
opts.on("-sSINCE", "--since=SINCE", Time, "Events after this date") do |s|
|
24
|
-
options[:since] = s.iso8601
|
25
|
-
end
|
26
|
-
|
27
|
-
opts.on("-dLAST", "--last=LAST", Integer, "Events since this many days ago") do |d|
|
28
|
-
now = Date.today
|
29
|
-
days_ago = (now - d)
|
30
|
-
options[:since] = days_ago.strftime('%Y-%m-%dT%H:%M:%SZ')
|
31
|
-
end
|
32
|
-
|
33
|
-
opts.on("-bUNTIL", "--until=UNTIL", Time, "Events before this date") do |u|
|
34
|
-
options[:until] = u.iso8601
|
35
|
-
end
|
36
|
-
|
37
|
-
opts.on("-lLIMIT", "--limit=LIMIT", Integer, "Only return this many events, Default 1000") do |l|
|
38
|
-
options[:limit] = l
|
39
|
-
end
|
40
|
-
|
41
|
-
opts.on("-tTYPE", "--type=TYPE", Integer, "Filter by event type id") do |t|
|
42
|
-
options[:event_type_id] = t
|
43
|
-
end
|
44
|
-
|
45
|
-
opts.on("-uUSER", "--user=USER", Integer, "Filter by user id") do |u|
|
46
|
-
options[:user_id] = u
|
47
|
-
end
|
48
|
-
|
49
|
-
# Sort direction is done by adding a + or - before the field name that you want to sort on
|
50
|
-
opts.on("-zSORT", "--sort=SORT", String, "Sort by this field") do |s|
|
51
|
-
options[:sort] = s
|
52
|
-
end
|
53
|
-
end.parse!
|
54
|
-
|
55
|
-
# Fetch the events
|
56
|
-
client = OneLogin::Api::Client.new(
|
57
|
-
client_id: 'ONELOGIN_CLIENT_ID_GOES_HERE',
|
58
|
-
client_secret: 'ONELOGIN_CLIENT_SECRET_GOES_HERE',
|
59
|
-
region: 'us'
|
60
|
-
)
|
61
|
-
|
62
|
-
attribute_names = ['id', 'created_at', 'account_id', 'user_id', 'user_name', 'event_type_id',
|
63
|
-
'notes', 'ipaddr', 'actor_user_id', 'actor_user_name', 'assuming_acting_user_id',
|
64
|
-
'role_id', 'role_name', 'app_id', 'app_name', 'group_id', 'group_name', 'otp_device_id',
|
65
|
-
'otp_device_name', 'policy_id', 'policy_name', 'actor_system', 'custom_message',
|
66
|
-
'operation_name', 'directory_sync_run_id', 'directory_id', 'resolution', 'client_id',
|
67
|
-
'resource_type_id', 'error_description', 'risk_score', 'risk_reasons', 'risk_cookie_id', 'browser_fingerprint']
|
68
|
-
|
69
|
-
counter = 0
|
70
|
-
limit = options[:limit] || 1000
|
71
|
-
|
72
|
-
# We remove limit from options parsed to the api as we want to fetch
|
73
|
-
# the max number of records possible and then use the cursor that is
|
74
|
-
# built into the ruby sdk to limit the results
|
75
|
-
options.delete(:limit)
|
76
|
-
|
77
|
-
CSV.open('events.csv', 'wb') do |csv|
|
78
|
-
puts "Exporting events to events.csv"
|
79
|
-
|
80
|
-
# header row
|
81
|
-
csv << attribute_names
|
82
|
-
|
83
|
-
# fetch the events
|
84
|
-
client.get_events(options).take(limit).each do |event|
|
85
|
-
csv << attribute_names.map { |attribute_name| event.send(attribute_name) if event.respond_to?(attribute_name) }
|
86
|
-
counter += 1
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
puts "Exported #{counter} events to events.csv"
|
91
|
-
|
92
|
-
|
93
|
-
|
@@ -1,88 +0,0 @@
|
|
1
|
-
require 'onelogin'
|
2
|
-
|
3
|
-
#
|
4
|
-
# This example shows how you can export user details from OneLogin using the Ruby SDK
|
5
|
-
#
|
6
|
-
# Usage:
|
7
|
-
# 1. Set your own CLIENT_ID and CLIENT_SECRET below
|
8
|
-
# 2. From terminal run "ruby all-users-to-csv.rb" to extract all users including
|
9
|
-
# any custom attributes that might have been defined for the each user
|
10
|
-
#
|
11
|
-
|
12
|
-
#client = OneLogin::Api::Client.new(
|
13
|
-
# client_id: 'ONELOGIN_CLIENT_ID',
|
14
|
-
# client_secret:'ONELOGIN_CLIENT_SECRET',
|
15
|
-
# region: 'us',
|
16
|
-
# max_results: 50000
|
17
|
-
#)
|
18
|
-
client = OneLogin::Api::Client.new(
|
19
|
-
client_id: 'ONELOGIN_CLIENT_ID_GOES_HERE',
|
20
|
-
client_secret: 'ONELOGIN_CLIENT_SECRET_GOES_HERE',
|
21
|
-
region: 'us',
|
22
|
-
max_results: 50000
|
23
|
-
)
|
24
|
-
|
25
|
-
|
26
|
-
user_attribute_names = ['id', 'username', 'email']
|
27
|
-
event_attribute_names = ['created_at', 'user_id', 'user_name', 'ipaddr', 'app_id', 'app_name']
|
28
|
-
csv_event_header = ['Timestamp', 'Description', 'Username', 'App', 'IP Address', 'User Id', 'Email', 'App Id']
|
29
|
-
|
30
|
-
user_options = {}
|
31
|
-
user_options[:fields] = user_attribute_names.join(",")
|
32
|
-
|
33
|
-
|
34
|
-
now = Date.today
|
35
|
-
days_ago = (now - 1)
|
36
|
-
event_options = {}
|
37
|
-
event_options[:since] = days_ago.strftime('%Y-%m-%dT%H:%M:%SZ')
|
38
|
-
event_options[:event_type_id] = 8;
|
39
|
-
event_options[:fields] = event_attribute_names.join(",")
|
40
|
-
event_options[:sort] = "-created_at"
|
41
|
-
|
42
|
-
now_str = Time.now.strftime("%Y-%m-%d_%H-%M-%S")
|
43
|
-
event_csv_name = now_str + '_events.csv'
|
44
|
-
|
45
|
-
users = {}
|
46
|
-
counter = 0
|
47
|
-
|
48
|
-
rate_limits = client.get_rate_limits
|
49
|
-
remaining_before = rate_limits.remaining
|
50
|
-
puts "Remaining RateLimit: #{remaining_before}"
|
51
|
-
|
52
|
-
puts "Extracting users from OneLogin"
|
53
|
-
|
54
|
-
client.get_users(user_options).each do |user|
|
55
|
-
users[user.id] = user
|
56
|
-
counter +=1
|
57
|
-
end
|
58
|
-
puts "#{counter} users extracted"
|
59
|
-
|
60
|
-
puts "Extracting events from OneLogin"
|
61
|
-
csv_event_header = ['Timestamp', 'Description', 'Username', 'App', 'IP Address', 'User Id', 'App Id', 'Email']
|
62
|
-
counter = 0
|
63
|
-
CSV.open(event_csv_name, 'wb') do |csv|
|
64
|
-
# header row
|
65
|
-
csv << csv_event_header
|
66
|
-
|
67
|
-
# fetch the events
|
68
|
-
client.get_events(event_options).each do |event|
|
69
|
-
username = email = ""
|
70
|
-
description = "#{event.user_name} signed into #{event.app_name}"
|
71
|
-
unless users.nil?
|
72
|
-
if users.has_key?(event.user_id)
|
73
|
-
username = users[event.user_id].username
|
74
|
-
email = users[event.user_id].email
|
75
|
-
end
|
76
|
-
end
|
77
|
-
csv << [event.created_at, description, username, event.app_name, event.ipaddr, event.user_id, event.app_id, email]
|
78
|
-
counter +=1
|
79
|
-
end
|
80
|
-
end
|
81
|
-
puts "Exported #{counter} events to events.csv"
|
82
|
-
|
83
|
-
rate_limits = client.get_rate_limits
|
84
|
-
remaining_after = rate_limits.remaining
|
85
|
-
puts "Remaining RateLimit: #{remaining_after}"
|
86
|
-
|
87
|
-
consumed = remaining_before - remaining_after
|
88
|
-
puts "The script consumed #{consumed} calls"
|
@@ -1,72 +0,0 @@
|
|
1
|
-
require 'onelogin'
|
2
|
-
require 'optparse'
|
3
|
-
require 'optparse/time'
|
4
|
-
|
5
|
-
#
|
6
|
-
# This generates a report listing the last login date for all users who have logged into a specified app in the last x days.
|
7
|
-
#
|
8
|
-
# Usage:
|
9
|
-
# 1. Set your own CLIENT_ID and CLIENT_SECRET below
|
10
|
-
# 2. From terminal run "ruby last-app-user-login-to-csv.rb"
|
11
|
-
# 3. Use the command line args to filter events
|
12
|
-
#
|
13
|
-
# e.g. "ruby last-app-user-login-to-csv.rb -l 90" for last 90 days
|
14
|
-
#
|
15
|
-
|
16
|
-
|
17
|
-
# Parse CLI arguments
|
18
|
-
options = {
|
19
|
-
event_type_id: 8, # User Logged into an App
|
20
|
-
sort: '-created_at'
|
21
|
-
}
|
22
|
-
|
23
|
-
OptionParser.new do |opts|
|
24
|
-
opts.banner = "Usage: last-app-user-login-to-csv.rb [options]"
|
25
|
-
|
26
|
-
opts.on("-lLAST", "--LAST=LAST", Integer, "Events since this many days ago") do |d|
|
27
|
-
now = Date.today
|
28
|
-
days_ago = (now - d)
|
29
|
-
options[:since] = days_ago.strftime('%Y-%m-%dT%H:%M:%SZ')
|
30
|
-
end
|
31
|
-
|
32
|
-
end.parse!
|
33
|
-
|
34
|
-
client = OneLogin::Api::Client.new(
|
35
|
-
client_id: 'ONELOGIN_CLIENT_ID_GOES_HERE',
|
36
|
-
client_secret: 'ONELOGIN_CLIENT_SECRET_GOES_HERE',
|
37
|
-
region: 'us',
|
38
|
-
max_results: 50000
|
39
|
-
)
|
40
|
-
|
41
|
-
counter = 0
|
42
|
-
|
43
|
-
logins = {}
|
44
|
-
|
45
|
-
# build a hash from events which contains user_id and latest login date
|
46
|
-
client.get_events(options).each do |event|
|
47
|
-
key = "#{event.app_id}-#{event.user_id}"
|
48
|
-
|
49
|
-
unless logins[key]
|
50
|
-
logins[key] = {
|
51
|
-
app_id: event.app_id,
|
52
|
-
app_name: event.app_name,
|
53
|
-
user_id: event.user_id,
|
54
|
-
user_name: event.user_name,
|
55
|
-
last_login_at: event.created_at
|
56
|
-
}
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
CSV.open('last-login-by-app.csv', 'wb') do |csv|
|
61
|
-
puts "Exporting user logins to last-login-by-app.csv"
|
62
|
-
|
63
|
-
# header row
|
64
|
-
csv << ['app_id', 'app_name', 'user_id', 'user_name', 'last_login_at']
|
65
|
-
|
66
|
-
logins.each do |login|
|
67
|
-
csv << login[1].values
|
68
|
-
counter += 1
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
puts "Exported #{counter} user logins to last-login-by-app.csv"
|
data/examples/list-users.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'onelogin'
|
2
|
-
|
3
|
-
client = OneLogin::Api::Client.new(
|
4
|
-
client_id: 'ONELOGIN_CLIENT_ID',
|
5
|
-
client_secret:'ONELOGIN_CLIENT_SECRET',
|
6
|
-
region: 'us'
|
7
|
-
)
|
8
|
-
|
9
|
-
# List all of the users in your account
|
10
|
-
# the sdk uses a cursor to keep requesting
|
11
|
-
# chunks of users as you loop through
|
12
|
-
|
13
|
-
client.get_users.each do |user|
|
14
|
-
puts "#{user.id} - #{user.firstname} - #{user.email}"
|
15
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
*.rbc
|
2
|
-
capybara-*.html
|
3
|
-
.rspec
|
4
|
-
/log
|
5
|
-
/tmp
|
6
|
-
/db/*.sqlite3
|
7
|
-
/db/*.sqlite3-journal
|
8
|
-
/public/system
|
9
|
-
/coverage/
|
10
|
-
/spec/tmp
|
11
|
-
*.orig
|
12
|
-
rerun.txt
|
13
|
-
pickle-email-*.html
|
14
|
-
|
15
|
-
|
16
|
-
# TODO Comment out this rule if you are OK with secrets being uploaded to the repo
|
17
|
-
config/initializers/secret_token.rb
|
18
|
-
|
19
|
-
# Only include if you have production secrets in this file, which is no longer a Rails default
|
20
|
-
config/secrets.yml
|
21
|
-
|
22
|
-
# dotenv
|
23
|
-
# TODO Comment out this rule if environment variables can be committed
|
24
|
-
.env
|
25
|
-
|
26
|
-
## Environment normalization:
|
27
|
-
/.bundle
|
28
|
-
/vendor/bundle
|
29
|
-
|
30
|
-
# these should all be checked in to normalize the environment:
|
31
|
-
Gemfile.lock, .ruby-version, .ruby-gemset
|
32
|
-
|
33
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
|
-
.rvmrc
|
35
|
-
|
36
|
-
# if using bower-rails ignore default bower_components path bower.json files
|
37
|
-
/vendor/assets/bower_components
|
38
|
-
*.bowerrc
|
39
|
-
bower.json
|
40
|
-
|
41
|
-
# Ignore pow environment settings
|
42
|
-
.powenv
|
43
|
-
|
44
|
-
# Ignore Byebug command history file.
|
45
|
-
.byebug_history
|
@@ -1 +0,0 @@
|
|
1
|
-
2.2.5
|