Open
Conversation
There was a problem hiding this comment.
PR Overview
This PR updates the API endpoint constants from version 1 to version 2, ensuring that all references use the latest API version.
- Updated user, role, and custom attribute URLs to API v2
- Added new endpoints for Smart MFA, API authorizations, Smart Hooks, User Mappings, Risk Rules, and App Rules
- Commented out legacy MFA endpoints and replaced them with their API v2 counterparts
Reviewed Changes
| File | Description |
|---|---|
| lib/onelogin/api/util/constants.rb | Refactored numerous API endpoints to align with API v2 |
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
lib/onelogin/api/util/constants.rb:158
- The constant 'UPDATE_RISK_RULESURL' appears to have a typo. For consistency with the naming of other constants, consider renaming it to 'UPDATE_RISK_RULES_URL'.
UPDATE_RISK_RULESURL = "https://api.%s.onelogin.com/api/2/risk/rules/%s"
|
lib/onelogin/api/client.rb is getting quite large. Can we refactor this into smaller chunks? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes multiple updates to the
lib/onelogin/api/util/constants.rbfile, mainly focusing on updating API endpoint URLs to version 2 and adding new endpoints. The key changes are grouped into updates to existing URLs and the addition of new URLs.Updates to existing URLs:
GET_USERS_URL,GET_USER_URL,GET_APPS_FOR_USER_URL,GET_CUSTOM_ATTRIBUTES_URL,CREATE_USER_URL,UPDATE_USER_URL,DELETE_USER_URL).GET_ROLES_URL,CREATE_ROLE_URL,GET_ROLE_URL).GET_SAML_ASSERTION_URL,GET_SAML_VERIFY_FACTOR).GET_FACTORS_URL,ENROLL_FACTOR_URL,GET_ENROLLED_FACTORS_URL,ACTIVATE_FACTOR_URL,REMOVE_FACTOR_URL).Addition of new URLs:
GET_CUSTOM_ATTRIBUTE,CREATE_CUSTOM_ATTRIBUTE,UPDATE_CUSTOM_ATTRIBUTE,DELETE_CUSTOM_ATTRIBUTE).UPDATE_ROLES_URL,DELETE_ROLES_URL,GET_APPS_ROLE_URL,SET_APPS_ROLE_URL,GET_ROLE_FOR_USERS_URL,ADD_ROLE_FOR_USERS_URL,REMOVE_ROLE_FOR_USERS_URL,GET_ROLE_FOR_ADMINS_URL,ADD_ROLE_FOR_ADMINS_URL,REMOVE_ROLE_FOR_ADMINS_URL).LIST_REPORTS_URL,RUN_REPORTS_URL,RUN_BACKGROUND_REPORTS_URL).CREATE_AUTHORIZATION_SERVER_URL,LIST_AUTHORIZATION_SERVER_URL,GET_AUTHORIZATION_SERVER_URL,UPDATE_AUTHORIZATION_SERVER_URL,DELETE_AUTHORIZATION_SERVER_URL,ADD_ACCESS_TOKEN_CLAIMS_URL,LIST_ACCESS_TOKEN_CLAIMS_URL,UPDATE_ACCESS_TOKEN_CLAIMS_URL,DELETE_ACCESS_TOKEN_CLAIMS_URL,ADD_SCOPE_URL,LIST_SCOPE_URL,UPDATE_SCOPE_URL,DELETE_SCOPE_URL,ADD_CLIENTS_APPS_URL,LIST_CLIENTS_APPS_URL,UPDATE_CLIENTS_APPS_URL,DELETE_CLIENTS_APPS_URL).GET_SMART_HOOK_URL,LIST_SMART_HOOKS_URL,GET_SMART_HOOK_LOGS_URL,CREATE_SMART_HOOK_URL,UPDATE_SMART_HOOK_URL,DELETE_SMART_HOOK_URL,CREATE_ENV_VAR_HOOK_URL,GET_ENV_VAR_HOOK_URL,UPDATE_ENV_VAR_HOOK_URL,DELETE_ENV_VAR_HOOK_URL,LIST_ENV_VAR_HOOKS_URL).GET_USER_MAPPING_URL,LIST_USER_MAPPING_URL,CREATE_USER_MAPPING_URL,UPDATE_USER_MAPPING_URL,DELETE_USER_MAPPING_URL,DRY_RUN_USER_MAPPING_URL,LIST_USER_MAPPING_CONDITION_URL,LIST_USER_MAPPING_CONDITION_OPTS_URL,LIST_USER_MAPPING_CONDITION_VALS_URL,LIST_USER_MAPPING_ACTIONS_URL,LIST_USER_MAPPING_ACTIONS_VAL_URL,BULK_SORT_USER_MAPPING_URL).GET_RISK_RULES_URL,LIST_RISK_RULES_URL,CREATE_RISK_RULES_URL,UPDATE_RISK_RULESURL,DELETE_RISK_RULES_URL,GET_RISK_SCORE_URL,GET_RISK_VERIFY_URL, `