Skip to content

IDSDEV-678-Add New Publishing Points for Token Failure#256

Open
tharsigam wants to merge 59 commits intoWSO2Telco:mig-release-2.2.0-integrationfrom
tharsigam:mig-release-2.2.0-integration
Open

IDSDEV-678-Add New Publishing Points for Token Failure#256
tharsigam wants to merge 59 commits intoWSO2Telco:mig-release-2.2.0-integrationfrom
tharsigam:mig-release-2.2.0-integration

Conversation

@tharsigam
Copy link

No description provided.

udithadissanayake and others added 30 commits April 25, 2017 09:10
IDSDEV-365 Mobile Connect Request Validator Capability in IDGW Related Development
…en creating SP when there is no SP available in the SP store,Bug fixed when taking token code from the SP which are created locally using UI
IDSDEV-548 Bug fixes for updating sp-configuration table,Bug fixed wh…
	* DB Wiring done
	* Multiple scope fix
	* Pom fix
#tc_checkbox {
/* Double-sized Checkboxes */
-ms-transform: scale(1.5); /* IE */
-moz-transform: scale(1.5); /* FF */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Remove this usage of the experimental "transform" property. rule

/* Double-sized Checkboxes */
-ms-transform: scale(1.5); /* IE */
-moz-transform: scale(1.5); /* FF */
-webkit-transform: scale(1.5); /* Safari and Chrome */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Remove this usage of the experimental "transform" property. rule

-ms-transform: scale(1.5); /* IE */
-moz-transform: scale(1.5); /* FF */
-webkit-transform: scale(1.5); /* Safari and Chrome */
-o-transform: scale(1.5); /* Opera */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Define the standard property right after this vendor-prefixed property. rule
MAJOR Remove this usage of the experimental "transform" property. rule

}

.btn-danger {
color: #fff !important;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Remove this usage of the "!important" annotation. rule

}

.btn-normal {
color: #fff !important;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Remove this usage of the "!important" annotation. rule


.btn-normal {
color: #fff !important;
background-color:#463F61 !important;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Remove this usage of the "!important" annotation. rule
MINOR Add one whitespace between the colon and the value. rule
MINOR Write hexadecimal value "#463F61" in lowercase. rule

.btn-normal {
color: #fff !important;
background-color:#463F61 !important;
border-color: #463F61 !important;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Remove this usage of the "!important" annotation. rule
MINOR Write hexadecimal value "#463F61" in lowercase. rule

color: #fff !important;
background-color:#463F61 !important;
border-color: #463F61 !important;
margin-top: 6px !important;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Remove this usage of the "!important" annotation. rule

margin-bottom: -1px;
background-color: #fff;
border: 1px solid #ddd;
border-left: 0px;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Remove the unit for this zero length. rule



.fa.pull-right {
margin-top: 0.5em;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Remove the leading zero. rule

DBUtil.insertConsentHistoryDetails(msisdn, apprScope, clientID, operatorID, "approve");
}
} catch (SQLException | NamingException e) {
e.printStackTrace();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Use a logger to log this exception. rule

* .application.authentication.framework.context.AuthenticationContext)
*/
@Override
public AuthenticatorFlowStatus process(HttpServletRequest request, HttpServletResponse response,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INFO Reduce the number of returns of this method 2, down to the maximum allowed 1. rule

else if(context.getProperty(Constants.APPROVED_ALL_SCOPES)!=null){
String approvedScopesString = context.getProperty(Constants.APPROVED_ALL_SCOPES).toString();
String approvedScopesStringMinBracket = approvedScopesString.substring( 1, approvedScopesString.length() - 1);
String[] approved_scopes = approvedScopesStringMinBracket.split( ", ");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. rule

import com.wso2telco.ids.datapublisher.model.UserStatus;
import com.wso2telco.ids.datapublisher.util.DataPublisherUtil;

// TODO: Auto-generated Javadoc

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INFO Complete the task associated to this TODO comment. rule

case Constants.APPROVEALL:
String scopesString = context.getProperty(Constants.APPROVED_ALL_SCOPES).toString();
String scopesStringMinBracket = scopesString.substring( 1, scopesString.length() - 1);
String[] api_Scopes = scopesStringMinBracket.split( ", ");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'. rule

DBUtil.insertConsentHistoryDetails(msisdn, apprScope, clientID, operatorID, "deny");
}
} catch (SQLException | NamingException e) {
e.printStackTrace();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Use a logger to log this exception. rule

approveAllScopes.add(apiApproveScope);
}
}
if (approveAllScopes.size() == 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Use isEmpty() to check whether the collection is empty or not. rule

* .AuthenticationContext)
*/
@Override
protected void initiateAuthenticationRequest(HttpServletRequest request, HttpServletResponse response,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL Refactor this method to reduce its Cognitive Complexity from 58 to the 15 allowed. rule

import org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException;
import org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException;
import org.wso2.carbon.identity.base.IdentityException;
import org.wso2.carbon.um.ws.api.stub.RemoteUserStoreManagerServiceStub;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Remove this unused import 'org.wso2.carbon.um.ws.api.stub.RemoteUserStoreManagerServiceStub'. rule

* @param userStatus
*/
public static void publishNewUserData(UserStatus userStatus) {
List<Object> userStatusMetaData = new ArrayList<Object>();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Replace the type specification in this constructor call with the diamond operator ("<>"). rule

@@ -60,140 +67,173 @@ public UserProfileManager() {
public boolean createUserProfileLoa2(String username, String operator, String scope) throws

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL Refactor this method to reduce its Cognitive Complexity from 26 to the 15 allowed. rule

userDTO.setUserName(username);

// add user DTO to the user registration admin service client
try {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Extract this nested try block into a separate method. rule

} else if (MOBILE_CLAIM_NAME.equalsIgnoreCase(userFieldDTOs[count].getClaimUri())) {
userFieldDTOs[count].setFieldValue(username);
if (AdminServiceUtil.isUserExists(username)) {
try {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Extract this nested try block into a separate method. rule

adminURL);

UserFieldDTO[] userFieldDTOs = new UserFieldDTO[0];
try {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Extract this nested try block into a separate method. rule

} else {
userFieldDTOs[count].setFieldValue("");
if (AdminServiceUtil.isUserExists(username)) {
try {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Extract this nested try block into a separate method. rule

adminURL);

UserFieldDTO[] userFieldDTOs = new UserFieldDTO[0];
try {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Extract this nested try block into a separate method. rule

userDTO.setUserName(username);

// add user DTO to the user registration admin service client
try {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Extract this nested try block into a separate method. rule

if (dataPublisherEnabled) {
//Publish event
Map<String, String> tokenMap = new HashMap<String, String>();
//Map<String, String> tokenMap = new HashMap<String, String>();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR This block of commented-out lines of code should be removed. rule

return parameters;
}

public static String getSPConfigValue(String operator, String clientID, String key)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INFO Reduce the number of returns of this method 2, down to the maximum allowed 1. rule

} catch (SQLException e) {
throw new SQLException("Error occurred while retrieving scopeID for scope : " + scope, e);
} catch (NamingException e) {
throw new ConfigurationException("DataSource could not be found in mobile-connect.xml");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL Define a constant instead of duplicating this literal "DataSource could not be found in mobile-connect.xml" 7 times. rule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants