Skip to content
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

fix: Rollback clientId in ApplicationSummary #6817

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
package org.orcid.core.manager.v3.impl;

import java.security.InvalidParameterException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.orcid.core.common.manager.EmailFrequencyManager;
import org.orcid.core.constants.RevokeReason;
Expand Down Expand Up @@ -83,6 +72,16 @@
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;

import javax.annotation.Resource;
import java.security.InvalidParameterException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* @author Declan Newman (declan) Date: 10/02/2012
*/
Expand Down Expand Up @@ -345,6 +344,7 @@ private void addApplicationToMap(OrcidOauth2TokenDetail token, Map<String, Appli
distinctApplications.put(client.getId(), applicationSummary);
applicationSummary.setScopePaths(new HashMap<String, String>());
applicationSummary.setName(client.getClientName());
applicationSummary.setClientId(client.getId());
applicationSummary.setWebsiteValue(client.getClientWebsite());
applicationSummary.setApprovalDate(token.getDateCreated());
}
Expand Down Expand Up @@ -702,4 +702,4 @@ private void clearRecord(String orcid, Boolean disableTokens) {
profileHistoryEventManager.recordEvent(ProfileHistoryEventType.SET_DEFAULT_VIS_TO_PRIVATE, orcid, "deactivated/deprecated");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public class ApplicationSummary {

private String name;

private String clientId;

private String websiteValue;

private Date approvalDate;
Expand All @@ -21,6 +23,10 @@ public void setName(String name) {
this.name = name;
}

public String getClientId() { return clientId; }

public void setClientId(String clientId) { this.clientId = clientId; }

public String getWebsiteValue() {
return websiteValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,11 @@ public void testGetApplications() {
assertTrue(applications.get(1).getScopePaths().keySet().contains(ScopePathType.READ_LIMITED.toString()));
assertTrue(applications.get(1).getScopePaths().keySet().contains(ScopePathType.ORCID_PROFILE_READ_LIMITED.toString()));
assertTrue(applications.get(1).getScopePaths().keySet().contains(ScopePathType.ACTIVITIES_UPDATE.toString()));


// test ordering based on name
assertEquals(CLIENT_ID_1, applications.get(0).getClientId());
assertEquals(CLIENT_ID_2, applications.get(1).getClientId());

//Assert we can delete them
profileEntityManager.disableClientAccess(CLIENT_ID_1, USER_ORCID);
profileEntityManager.disableClientAccess(CLIENT_ID_2, USER_ORCID);
Expand Down