-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API client functions for RecoveryAPI V2 and on demand migration for new configs. #5744
Add API client functions for RecoveryAPI V2 and on demand migration for new configs. #5744
Conversation
… from the RecoveryAPI V2"" This reverts commit 6111d57.
PR builder started |
PR builder completed |
PR builder started |
PR builder completed |
final String localVarAccept = apiClient.selectHeaderAccept( | ||
new String[]{FrameworkConstants.ContentTypes.TYPE_APPLICATION_JSON}); | ||
final String localVarContentType = apiClient.selectHeaderContentType( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to define two different variables for localVarAccept and localVarContentType?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo having these two in two variables makes the code clearer opposed to having this inside the parameter list of invokeAPI function call.
...t/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/IdentityProviderManager.java
Outdated
Show resolved
Hide resolved
|
||
// Enable all recovery options when Recovery.Notification.Password.Enable value is set as enabled. | ||
// This keeps functionality consistent with previous API versions for migrating customers. | ||
idpProperties.stream().filter(idp -> idp.getName().equals(EMAIL_LINK_PASSWORD_RECOVERY_PROPERTY)).findFirst() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we switch the attributes order in with equals method to prevent possible null pointers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check other places as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed with f5e241a
@@ -121,6 +121,14 @@ public class IdPManagementDAO { | |||
private static final Log log = LogFactory.getLog(IdPManagementDAO.class); | |||
|
|||
private static final String OPENID_IDP_ENTITY_ID = "IdPEntityId"; | |||
private static final String NOTIFICATION_PASSWORD_ENABLE_PROPERTY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move these variables to a constant class and refer every places these are used. I can see few places where we have defined these as private variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to IdPManagementConstants with f5e241a
import static org.wso2.carbon.idp.mgt.util.IdPManagementConstants.PRESERVE_LOCALLY_ADDED_CLAIMS; | ||
|
||
public class IdPManagementUtil { | ||
|
||
private static final Log log = LogFactory.getLog(IdPManagementUtil.class); | ||
|
||
private static final String RECOVERY_NOTIFICATION_PASSWORD_PROPERTY = "Recovery.Notification.Password.Enable"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move these to a common constant class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to IdPManagementConstants with f5e241a
private static final String RECOVERY_NOTIFICATION_PASSWORD_PROPERTY = "Recovery.Notification.Password.Enable"; | ||
private static final String EMAIL_LINK_PASSWORD_RECOVERY_PROPERTY | ||
= "Recovery.Notification.Password.emailLink.Enable"; | ||
private static final String SMS_OTP_PASSWORD_RECOVERY_PROPERTY = "Recovery.Notification.Password.smsOtp.Enable"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we added these configs to identity.xml, identity.xml.j2 and default.json files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. These are governance configs which are stored in the database as resident IDP properties.
@Override | ||
public String toString() { | ||
|
||
return "class RecoveryResponse {\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the approach use in other response classes to implement this toString method? using a StringBuilder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed with 8132e60
@@ -4080,4 +4080,10 @@ | |||
</CacheInvalidator> | |||
{% endif %} | |||
|
|||
<ConfigSwitching> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a practice, we add these configs to identity.xml file as well. Shall we add this to identity.xml file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed with 8132e60
Proposed changes in this pull request
-Adds the API client functions for RecoveryAPI V2.
Related Issues
Related PRs
When should this PR be merged
Should be merged along with all other related PRs for the feature since there are inter dependencies.
Follow up actions
Checklist (for reviewing)
General
Functionality
Code
Tests
Security
Documentation