Skip to content

Commit

Permalink
Shib: remove old debugging code #2916 #2939
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Mar 15, 2016
1 parent 7943bcc commit 5c19ca0
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,31 +265,4 @@ public DvObject getDvObject() {
}

}

private Boolean debugShibboleth = null;

public boolean isDebugShibboleth() {
if (debugShibboleth != null) {
return debugShibboleth;
}
debugShibboleth = systemConfig.isDebugEnabled();
return debugShibboleth;
}

public List<String> getGroups(User user) {
List<String> groups = new ArrayList<>();
Set<Group> groupsForUser = groupService.groupsFor(user, null);
for (Group group : groupsForUser) {
groups.add(group.getDisplayName() + " (" + group.getIdentifier() + ")");
}
return groups;
}

public List<String> getPermissions(User user, Dataverse dataverse) {
List<String> permissions = new ArrayList<>();
for (Permission permission : permissionService.permissionsFor(user, dataverse)) {
permissions.add(permission.name());
}
return permissions;
}
}
25 changes: 0 additions & 25 deletions src/main/java/edu/harvard/iq/dataverse/Shib.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,23 +227,6 @@ public void init() {
internalUserIdentifer = ShibUtil.generateFriendlyLookingUserIdentifer(usernameAssertion, emailAddress);
logger.info("friendly looking identifer (backend will enforce uniqueness):" + internalUserIdentifer);

/**
* @todo Remove, longer term. For now, commenting out special logic for
* always showing Terms of Use for TestShib accounts. The Terms of Use
* workflow is captured at
* http://datascience.iq.harvard.edu/blog/try-out-single-sign-shibboleth-40-beta
*/
// if (shibIdp.equals("https://idp.testshib.org/idp/shibboleth")) {
// StringBuilder sb = new StringBuilder();
// String freshNewShibUser = sb.append(userIdentifier).append(UUID.randomUUID()).toString();
// logger.info("Will create a new, unique user so the account Terms of Use will be displayed.");
// userIdentifier = freshNewShibUser;
// }
/**
* @todo Shouldn't we persist the displayName too? It still exists on
* the authenticateduser table.
*/
// String displayName = getDisplayName(displayNameAttribute, firstNameAttribute, lastNameAttribute);
String affiliation = shibService.getAffiliation(shibIdp, shibService.getDevShibAccountType());
if (affiliation != null) {
affiliationToDisplayAtConfirmation = affiliation;
Expand All @@ -270,15 +253,7 @@ public void init() {
} else {
state = State.PROMPT_TO_CREATE_NEW_ACCOUNT;
displayNameToPersist = displayInfo.getTitle();
// firstNameToPersist = "foo";
// lastNameToPersist = "bar";
emailToPersist = emailAddress;
/**
* @todo For Harvard at least, we plan to use "Harvard University"
* for affiliation because it's what we get from
* https://dataverse.harvard.edu/Shibboleth.sso/DiscoFeed
*/
// affiliationToPersist = "FIXME";
/**
* @todo for Harvard we plan to use the value(s) from
* eduPersonScopedAffiliation which
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ public enum Key {
* to from the footer.
*/
ApplicationPrivacyPolicyUrl,
/** Expose debug information in the UI that users shouldn't normally see. */
Debug,
/**
* A boolean defining if indexing and search should respect the concept
* of "permission root".
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,6 @@ public boolean isShibEnabled() {
return settingsService.isTrueForKey(SettingsServiceBean.Key.ShibEnabled, safeDefaultIfKeyNotFound);
}

// TODO:
// remove these method!
// pages should be using settingsWrapper.isTrueForKey(":Debug", false) instead. -- 4.2.1
public boolean isDebugEnabled() {
boolean safeDefaultIfKeyNotFound = false;
return settingsService.isTrueForKey(SettingsServiceBean.Key.Debug, safeDefaultIfKeyNotFound);
}

public boolean myDataDoesNotUsePermissionDocs() {
boolean safeDefaultIfKeyNotFound = false;
return settingsService.isTrueForKey(SettingsServiceBean.Key.MyDataDoesNotUseSolrPermissionDocs, safeDefaultIfKeyNotFound);
Expand Down
5 changes: 0 additions & 5 deletions src/main/webapp/dataverse_header.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@
</div>
</div>
</nav>
<ui:fragment rendered="#{dataverseHeaderFragment.debugShibboleth}">
<h:outputText value="groups: #{dataverseHeaderFragment.getGroups(dataverseSession.user)}"/>
<br/>
<h:outputText value="permissions #{dataverseHeaderFragment.getPermissions(dataverseSession.user, dataverse)}"/>
</ui:fragment>
<ui:param name="dataversePage" value="#{dataverseLinksStayOnPage == true ? '' : '/dataverse.xhtml' }"/>

<!-- Header Panel -->
Expand Down

0 comments on commit 5c19ca0

Please sign in to comment.