Skip to content

Commit

Permalink
Fixes #591
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Dec 17, 2024
1 parent 060cc30 commit 0831582
Show file tree
Hide file tree
Showing 20 changed files with 9 additions and 135 deletions.
2 changes: 1 addition & 1 deletion dashboard-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.openconext</groupId>
<artifactId>dashboard</artifactId>
<version>13.0.0-SNAPSHOT</version>
<version>13.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
15 changes: 0 additions & 15 deletions dashboard-gui/src/javascripts/components/connect_modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,21 +197,6 @@ export default function ConnectModal({ app, currentUser, isOpen, onClose, onSubm
)
}

if (!currentIdp.publishedInEdugain && app.publishedInEdugain) {
return (
<ConnectModalContainer isOpen={isOpen} onClose={onClose}>
<div className="connect-modal-header">{I18n.t('how_to_connect_panel.not_published_in_edugain_idp')}</div>
<div className="connect-modal-body">
<p>{I18n.t('how_to_connect_panel.not_published_in_edugain_idp_info', { name: app.name })} </p>
<br />
<Link className="c-button" to={'/my-idp/edit'}>
{I18n.t('how_to_connect_panel.edit_my_idp_link')}
</Link>
</div>
</ConnectModalContainer>
)
}

return (
<ConnectModalContainer isOpen={isOpen} onClose={onClose}>
<div className="connect-modal-header">{I18n.t(`how_to_connect_panel.${title}`, { app: app.name })}</div>
Expand Down
12 changes: 0 additions & 12 deletions dashboard-gui/src/javascripts/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,18 +813,6 @@ I18n.translations.en = {
date_published_in_edugain: 'Date published in eduGAIN',
logo_url: 'Logo',
new_logo_url: 'New logo URL',
research_and_scholarship_info: 'Connect to CoCo R&S SP’s automatically',
research_and_scholarship_tooltip:
'Your IdP will be automatically connected to all SPs in<br>SURFconext adhering to both ‘Research & Scholarship Entity Category’<br>and the ‘GEANT Data Protection Code of Conduct’, releasing the R&S attributes. <br>See the <a href="https://support.surfconext.nl/dashboard-help-rns" target="_blank" rel="noopener noreferrer">wiki</a> for more information.',
allow_maintainers_to_manage_authz_rules: 'Allow SURFconext maintainers to manage Authorization rules',
allow_maintainers_to_manage_authz_rules_tooltip:
'The SURFconext maintainers of your IdP are allowed to create, edit and delete<br>Authorization rules.',
displayAdminEmailsInDashboard: 'Allow regular members to see admin contacts',
displayAdminEmailsInDashboardTooltip:
'Regular members of your institution can see the email address of the SURFconext owners <br>and owners of applications of this institution.',
displayStatsInDashboard: 'Allow regular members to see statistics',
displayStatsInDashboardTooltip:
'Regular members of your institution can see the usage / statistics of the applications connected<br>to this institution.',
contact: 'Contact persons',
contact_name: {
title: 'Contact name',
Expand Down
12 changes: 0 additions & 12 deletions dashboard-gui/src/javascripts/locale/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,18 +813,6 @@ I18n.translations.nl = {
date_published_in_edugain: 'Datum gepubliceerd in eduGAIN',
logo_url: 'Logo',
new_logo_url: 'Nieuwe logo URL',
research_and_scholarship_info: "Koppel met SP's die aan CoCo en R&S voldoen",
research_and_scholarship_tooltip:
'Je IdP wordt automatisch aan alle huidige en toekomstige SP\'s in SURFconext gekoppeld die voldoen aan zowel<br>‘Research & Scholarship Entity Category’ en de ‘GEANT Data Protection Code of Conduct ’, waarbij de R&S attributen aan de SP worden vrijgegeven.<br/>Zie de <a href="https://support.surfconext.nl/dashboard-help-rns" target="_blank" rel="noopener noreferrer">wiki</a> vooor meer informatie.',
allow_maintainers_to_manage_authz_rules: 'SURFconextbeheerders mogen autorisatieregels beheren',
allow_maintainers_to_manage_authz_rules_tooltip:
'De SURFconextbeheerders van je instelling mogen autorisatieregels aanmaken, bewerken en verwijderen.',
displayAdminEmailsInDashboard: 'Leden kunnen admin email-adres zien',
displayAdminEmailsInDashboardTooltip:
'De email adressen van de SURFconextbeheerders worden getoond aan reguliere gebruikers<br>van je instelling.',
displayStatsInDashboard: 'Leden kunnen statistieken zien',
displayStatsInDashboardTooltip:
'Het gebruik / statistieken van alle applicaties gekoppeld<br>aan je instelling kunnen worden bekeken door reguliere gebruikers<br>van je instelling.',
contact: 'Contactpersonen',
contact_name: {
title: 'Contact naam',
Expand Down
12 changes: 0 additions & 12 deletions dashboard-gui/src/javascripts/locale/pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,18 +777,6 @@ I18n.translations.pt = {
date_published_in_edugain: 'Data de publicação no eduGAIN',
logo_url: 'Logo',
new_logo_url: 'URL do Novo logo ',
research_and_scholarship_info: "Ligar-se automáticamente aos SP's compatíveis com a categoria CoCo R&S",
research_and_scholarship_tooltip:
'Isto significa que o vosso IdP ativa automáticamente ligações para todos os SPs na <br>SURFconext que aderiram à categoria ‘Research & Scholarship Entity Category’<br> e ‘GEANT Data Protection Code of Conduct’, libertanto os atributos R&S. <br>Consulte<a href="https://support.surfconext.nl/dashboard-help-rns" target="_blank" rel="noopener noreferrer">wiki</a> para mais informações.',
allow_maintainers_to_manage_authz_rules: 'Allow maintainers to manage Authorization rules',
allow_maintainers_to_manage_authz_rules_tooltip:
'This means the maintainers of your<br>IdP are allow to create / edit and delete<br>Authorization rules.',
displayAdminEmailsInDashboard: 'Allow members to see admin emails',
displayAdminEmailsInDashboardTooltip:
'This means that regular members of your institution<br>can see the emails of the SURFconext maintainers<br>and owners of this institution.',
displayStatsInDashboard: 'Allow regular members to see statistics',
displayStatsInDashboardTooltip:
'This means that regular members of your institution<br>can see the usage / statistics of the connected services<br>to this institution.',
contact: 'Contacto',
contact_name: {
title: 'Nome do contacto',
Expand Down
6 changes: 0 additions & 6 deletions dashboard-gui/src/javascripts/pages/edit_my_idp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ class EditMyIdp extends React.Component {
organisationNameNl: currentIdp.organisationNames.nl || '',
organisationDisplayNameEn: currentIdp.organisationDisplayNames.en || '',
organisationDisplayNameNl: currentIdp.organisationDisplayNames.nl || '',
publishedInEdugain: !!currentIdp.publishedInEdugain,
connectToRSServicesAutomatically: !!currentIdp.connectToRSServicesAutomatically,
allowMaintainersToManageAuthzRules: !!currentIdp.allowMaintainersToManageAuthzRules,
displayAdminEmailsInDashboard: !!currentIdp.displayAdminEmailsInDashboard,
displayStatsInDashboard: !!currentIdp.displayStatsInDashboard,
comments: '',
contactPersons: currentIdp.contactPersons.map((contactPerson) => ({
name: contactPerson.name || '',
Expand Down Expand Up @@ -451,7 +446,6 @@ class EditMyIdp extends React.Component {
descriptionNl: s.descriptions.nl,
displayNameEn: s.displayNames.en,
displayNameNl: s.displayNames.nl,
publishedInEdugain: s.publishedInEdugain,
hasGuestEnabled: s.guestEnabled,
noConsentRequired: s.noConsentRequired,
contactPersons: s.contactPersons,
Expand Down
2 changes: 1 addition & 1 deletion dashboard-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<groupId>org.openconext</groupId>
<artifactId>dashboard</artifactId>
<version>13.0.0-SNAPSHOT</version>
<version>13.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dashboard-server/src/main/java/dashboard/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public LocaleResolver localeResolver(@Value("${supported_language_codes}") Strin
String language = Stream.of(supportLanguageCodes.split(",")).map(String::trim).findFirst().orElse("nl");
CookieThenAcceptHeaderLocaleResolver localeResolver = new CookieThenAcceptHeaderLocaleResolver();
localeResolver.setCookieName(LANG);
localeResolver.setDefaultLocale(new Locale(language));
localeResolver.setDefaultLocale(Locale.of(language));
localeResolver.setCookieMaxAge(315360000);
return localeResolver;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ public class IdpController extends BaseController {
@RequestMapping("/current/roles")
public ResponseEntity<RestResponse<Map<String, Collection<SabPerson>>>> roles(@RequestHeader(Constants.HTTP_X_IDP_ENTITY_ID) String idpEntityId) {
Optional<IdentityProvider> optionalIdentityProvider = SpringSecurity.getCurrentUser().getByEntityId(idpEntityId);
boolean displayAdminEmailsInDashboard = optionalIdentityProvider.map(idp -> idp.isDisplayAdminEmailsInDashboard()).orElse(false);

if (SpringSecurity.getCurrentUser().isGuest() || (SpringSecurity.getCurrentUser().isDashboardMember() && !displayAdminEmailsInDashboard)) {
if (SpringSecurity.getCurrentUser().isGuest() || SpringSecurity.getCurrentUser().isDashboardMember()) {
return new ResponseEntity<>(createRestResponse(Collections.emptyMap()), HttpStatus.OK);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ public List<String[]> download(@RequestBody Map<String, Object> body,
service.getSupportMail(),
String.valueOf(service.isConnected()),
licenseStatus != null ? licenseStatus.name() : LicenseStatus.UNKNOWN.name(),
String.valueOf(service.isPublishedInEdugain()),
String.valueOf(service.isExampleSingleTenant()),
String.valueOf(service.isStrongAuthentication()),
String.valueOf(arp != null ? !arp.isNoArp() : false),
Expand All @@ -157,8 +156,7 @@ public List<String[]> download(@RequestBody Map<String, Object> body,

Stream<String[]> headers = Stream.<String[]>of(new String[]{
"id", "name", "organisation-name", "entityID", "description", "app-url", "wiki-url", "support-mail",
"connected", "licenseStatus",
"publishedInEdugain", "singleTenant", "strongAuthentication",
"connected", "licenseStatus", "singleTenant", "strongAuthentication",
"arpEnabled", "arpAttributes"});

List<String[]> rows = Stream.concat(headers, values).collect(toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@ public RestResponse<List<Service>> serviceProviders(Locale locale) throws IOExce
List<Service> usersServices = getServiceProvidersForCurrentUser(locale);

CoinUser currentUser = SpringSecurity.getCurrentUser();
IdentityProvider idp = currentUser.getSwitchedToIdp().orElse(currentUser.getIdp());
boolean eraseMails = currentUser.isGuest() || (currentUser.isDashboardMember() && !idp.isDisplayAdminEmailsInDashboard());
boolean eraseMails = currentUser.isGuest() || currentUser.isDashboardMember();
if (eraseMails) {
usersServices = usersServices.stream().map(service -> ServicesController.eraseMailsFromService(service)).collect(toList());
}
Expand Down Expand Up @@ -565,22 +564,6 @@ protected Map<String, Object> getPathUpdates(Settings settings, IdentityProvider
this.diff(pathUpdates, idp.getDisplayNames().get("nl"), settings.getDisplayNamesNl(), "displayName:nl");
this.diff(pathUpdates, idp.getDisplayNames().get("pt"), settings.getDisplayNamesPt(), "displayName:pt");

this.diff(pathUpdates, idp.isPublishedInEdugain(), settings.isPublishedInEdugain(),
"coin:publish_in_edugain");

if (changed(idp.isConnectToRSServicesAutomatically(), settings.isConnectToRSServicesAutomatically())) {
pathUpdates.put("metaDataFields.coin:entity_categories:1", "http://refeds.org/category/research-and-scholarship");
}

this.diff(pathUpdates, idp.isAllowMaintainersToManageAuthzRules(), settings.isAllowMaintainersToManageAuthzRules(),
"coin:allow_maintainers_to_manage_authz_rules");

this.diff(pathUpdates, idp.isDisplayAdminEmailsInDashboard(), settings.isDisplayAdminEmailsInDashboard(),
"coin:display_admin_emails_in_dashboard");

this.diff(pathUpdates, idp.isDisplayStatsInDashboard(), settings.isDisplayStatsInDashboard(),
"coin:display_stats_in_dashboard");

this.diff(pathUpdates, idp.getState(), settings.getStateType() != null ? settings.getStateType().name() : null, "state");

diffContactPersons(pathUpdates, idp.getContactPersons(), settings.getContactPersons());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class IdentityProvider extends Provider implements Serializable {
private Map<String, String> organisationNames = new HashMap<>();
private Map<String, String> organisationDisplayNames = new HashMap<>();
private boolean allowMaintainersToManageAuthzRules;
private boolean displayAdminEmailsInDashboard;
private boolean displayStatsInDashboard;
private List<Map<String, String>> stepupEntities;
private List<Map<String, String>> mfaEntities;
Expand Down Expand Up @@ -70,7 +69,6 @@ public IdentityProvider(Map<String, Object> metaData) {
organisationDisplayNames.put("en", (String) metaData.get("OrganizationDisplayName:en"));
organisationDisplayNames.put("nl", (String) metaData.get("OrganizationDisplayName:nl"));
allowMaintainersToManageAuthzRules = booleanValue(metaData.get("coin:allow_maintainers_to_manage_authz_rules"));
displayAdminEmailsInDashboard = booleanValue(metaData.get("coin:display_admin_emails_in_dashboard"));
displayStatsInDashboard = booleanValue(metaData.get("coin:display_stats_in_dashboard"));

this.stepupEntities = (List<Map<String, String>>) metaData.getOrDefault("stepupEntities", new ArrayList<>());
Expand Down Expand Up @@ -99,10 +97,6 @@ public List<Consent> getDisableConsent() {
return disableConsent;
}

public boolean isConnectToRSServicesAutomatically() {
return connectToRSServicesAutomatically;
}

public Map<String, String> getOrganisationNames() {
return organisationNames;
}
Expand Down Expand Up @@ -131,10 +125,6 @@ public boolean isAllowMaintainersToManageAuthzRules() {
return allowMaintainersToManageAuthzRules;
}

public boolean isDisplayAdminEmailsInDashboard() {
return displayAdminEmailsInDashboard;
}

public boolean isDisplayStatsInDashboard() {
return displayStatsInDashboard;
}
Expand Down
6 changes: 0 additions & 6 deletions dashboard-server/src/main/java/dashboard/domain/Provider.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public abstract class Provider implements Comparable<Provider>, Serializable {
private boolean allowedAll;
private Set<String> allowedEntityIds;
private boolean noConsentRequired;
private boolean publishedInEdugain;

public Provider() {
}
Expand Down Expand Up @@ -103,7 +102,6 @@ public Provider(Map<String, Object> metaData) {
this.allowedAll = getAllowedAll(metaData);
this.allowedEntityIds = getAllowedEntries(metaData);
this.noConsentRequired = booleanValue(metaData.get("coin:no_consent_required"));
this.publishedInEdugain = booleanValue(metaData.get("coin:publish_in_edugain"));
this.publishInEdugainDate = (String) metaData.get("coin:publish_in_edugain_date");
}

Expand Down Expand Up @@ -271,10 +269,6 @@ public String getPublishInEdugainDate() {
return publishInEdugainDate;
}

public boolean isPublishedInEdugain() {
return publishedInEdugain;
}

public String getState() {
return state;
}
Expand Down
12 changes: 0 additions & 12 deletions dashboard-server/src/main/java/dashboard/domain/Service.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public class Service implements Comparable<Service>, Serializable {

private boolean connected;
private boolean idpVisibleOnly;
private boolean publishedInEdugain;
private Boolean normenkaderPresent;
private boolean exampleSingleTenant;
private boolean policyEnforcementDecisionRequired;
Expand Down Expand Up @@ -336,17 +335,6 @@ public void setWikiUrl(String wikiUrl) {
this.wikiUrl = wikiUrl;
}

public boolean isPublishedInEdugain() {
return publishedInEdugain;
}

public void setPublishedInEdugain(boolean publishedInEdugain) {
this.publishedInEdugain = publishedInEdugain;
}

public String getPublishInEdugainDate() {
return publishInEdugainDate;
}

public void setPublishInEdugainDate(String publishInEdugainDate) {
this.publishInEdugainDate = publishInEdugainDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public class ServiceProviderSettings {
private String spEntityId;
private boolean hasGuestEnabled;
private boolean noConsentRequired;
private boolean publishedInEdugain;
private String displayNameEn;
private String displayNameNl;
private String displayNamePt;
Expand Down Expand Up @@ -44,14 +43,6 @@ public void setNoConsentRequired(boolean noConsentRequired) {
this.noConsentRequired = noConsentRequired;
}

public boolean isPublishedInEdugain() {
return publishedInEdugain;
}

public void setPublishedInEdugain(boolean publishedInEdugain) {
this.publishedInEdugain = publishedInEdugain;
}

public String getDisplayNameEn() {
return displayNameEn;
}
Expand Down Expand Up @@ -122,7 +113,6 @@ public String toString() {
"spEntityId='" + spEntityId + '\'' +
", hasGuestEnabled=" + hasGuestEnabled +
", noConsentRequired=" + noConsentRequired +
", publishedInEdugain=" + publishedInEdugain +
", displayNameEn='" + displayNameEn + '\'' +
", displayNameNl='" + displayNameNl + '\'' +
", displayNamePt='" + displayNamePt + '\'' +
Expand Down
4 changes: 0 additions & 4 deletions dashboard-server/src/main/java/dashboard/domain/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,11 @@ public class Settings {
private String organisationDisplayNameEn;
private String organisationDisplayNameNl;
private String organisationDisplayNamePt;
private boolean publishedInEdugain;
private boolean connectToRSServicesAutomatically;
private boolean allowMaintainersToManageAuthzRules;
private String comments;
private StateType stateType;
private ConsentType consentType;

private List<ContactPerson> contactPersons;
private boolean displayAdminEmailsInDashboard;
private boolean displayStatsInDashboard;

private String typeMetaData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ private void plainProperties(ServiceProvider sp, Service service) {
service.setIdpVisibleOnly(sp.isIdpVisibleOnly());
service.setPolicyEnforcementDecisionRequired(sp.isPolicyEnforcementDecisionRequired());
service.setInstitutionId(sp.getInstitutionId());
service.setPublishedInEdugain(sp.isPublishedInEdugain());
service.setLicenseStatus(sp.getLicenseStatus());
service.setEntityType(sp.getEntityType());
service.setExampleSingleTenant(sp.getEntityType().equals(EntityType.single_tenant_template));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,9 @@ protected Object getPreAuthenticatedPrincipal(final HttpServletRequest request)

if (coinUser.isDashboardMember()) {
IdentityProvider idp = coinUser.getIdp();
if (!idp.isDisplayAdminEmailsInDashboard()) {
idp.getContactPersons().clear();
}
idp.getContactPersons().clear();
coinUser.getInstitutionIdps().forEach(anIdp -> {
if (!anIdp.isDisplayAdminEmailsInDashboard()) {
anIdp.getContactPersons().clear();
}
anIdp.getContactPersons().clear();
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28460,7 +28460,6 @@
"contacts:3:contactType": "support",
"SingleSignOnService:0:Location": "http://mock-idp/saml2/idp/SSOService.php",
"coin:entity_categories:5": "http://refeds.org/category/research-and-scholarship",
"coin:display_admin_emails_in_dashboard": true,
"coin:display_stats_in_dashboard": true
},
"allowedEntities": [
Expand Down Expand Up @@ -32142,7 +32141,6 @@
"OrganizationDisplayName:nl": "SURF",
"contacts:3:contactType": "technical",
"SingleSignOnService:0:Location": "https://idp.surf.nl/saml2/idp/SSOService.php",
"coin:display_admin_emails_in_dashboard": false,
"coin:display_stats_in_dashboard": false
},
"allowedEntities": [
Expand Down
Loading

0 comments on commit 0831582

Please sign in to comment.