Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/maven/fixes/9.0' into maven/rele…
Browse files Browse the repository at this point in the history
…ase/9.0
  • Loading branch information
metaventis-build committed Nov 6, 2024
2 parents df21df0 + 38bfa54 commit 6a7e084
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public DOI getBasicMapping(String nodeId, Map<QName, Serializable> properties, b
List<String> author = (List<String>) properties.get(QName.createQName(CCConstants.CCM_PROP_IO_REPL_LIFECYCLECONTRIBUTER_AUTHOR));
List<String> authorFreetext = (List<String>) properties.get(QName.createQName(CCConstants.CCM_PROP_AUTHOR_FREETEXT));
if(author == null || author.isEmpty()){
if((authorFreetext == null || authorFreetext.isEmpty()) && failOnMissing){
if((authorFreetext == null || authorFreetext.isEmpty() || authorFreetext.stream().filter(StringUtils::isNotBlank).findAny().isEmpty()) && failOnMissing){
throw new DOIServiceMissingAttributeException(CCConstants.getValidLocalName(CCConstants.CCM_PROP_IO_REPL_LIFECYCLECONTRIBUTER_AUTHOR),"Creator");
}
}
Expand All @@ -184,7 +184,7 @@ public DOI getBasicMapping(String nodeId, Map<QName, Serializable> properties, b
.add(Data.Creator.builder().name(VCardConverter.getNameForVCardString(a)).build()));
}
if(authorFreetext != null && !authorFreetext.isEmpty()){
authorFreetext.stream().forEach(a -> doi.getData().getAttributes().getCreators()
authorFreetext.stream().filter(StringUtils::isNotBlank).forEach(a -> doi.getData().getAttributes().getCreators()
.add(Data.Creator.builder().name(a).build()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
import org.edu_sharing.alfresco.lightbend.LightbendConfigLoader;
Expand Down Expand Up @@ -42,6 +43,7 @@
import org.springframework.security.web.util.matcher.RequestMatcher;
import org.springframework.util.StringUtils;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
Expand All @@ -51,6 +53,7 @@
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.security.interfaces.RSAPrivateKey;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -198,8 +201,25 @@ RelyingPartyRegistrationRepository relyingPartyRegistrationRepository() {
RSAPrivateKey privateKey = converter.convert(pkInputStream);

String globalSPRegistrationId = "one";
List<RelyingPartyRegistration> relyingPartyRegistration = RelyingPartyRegistrations
.collectionFromMetadataLocation(config.getString("security.sso.saml.idp.metadata.url"))


Collection<RelyingPartyRegistration.Builder> b = null;
String cfgMetadataPath = "security.sso.saml.idp.metadata";
if(config.hasPath(cfgMetadataPath +".content")){
b = RelyingPartyRegistrations.collectionFromMetadata(IOUtils.toInputStream(config.getString(cfgMetadataPath +".content")));
}else if(config.hasPath(cfgMetadataPath +".filePath")){
File f = new File(config.getString(cfgMetadataPath +".filePath"));
b = RelyingPartyRegistrations.collectionFromMetadata(FileUtils.openInputStream(f));
}else if(config.hasPath(cfgMetadataPath + ".url")){
b = RelyingPartyRegistrations
.collectionFromMetadataLocation(config.getString(cfgMetadataPath + ".url"));
}

if(b == null){
throw new RuntimeException("no IDP metadata configured");
}

List<RelyingPartyRegistration> relyingPartyRegistration = b
.stream().map((builder) -> {
String relyingPartyId = getRelyingPartyId(builder);
return builder.registrationId(relyingPartyId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class LicenseDialogContentComponent implements OnInit {
}
} else {
// if no version is selected select 4.0 by default
if (!this.ccVersion) this.ccVersion = '4.0';
if (!['2.0', '3.0', '4.0'].includes(this.ccVersion)) this.ccVersion = '4.0';
}
this._primaryType = primaryType;
this.updateCanSave();
Expand Down Expand Up @@ -682,6 +682,7 @@ export class LicenseDialogContentComponent implements OnInit {
if (this.ccProfileUrl) {
prop[RestConstants.CCM_PROP_LICENSE_PROFILE_URL] = [this.ccProfileUrl];
}

if (this.ccVersion) {
prop[RestConstants.CCM_PROP_LICENSE_CC_VERSION] = [this.ccVersion];
// make sure v4.0 has no locale
Expand Down
3 changes: 1 addition & 2 deletions Frontend/src/app/modules/workspace/workspace.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ export class WorkspaceMainComponent implements EventListener, OnInit, OnDestroy
await this.prepareActionbar();
await this.initUser();
this.loadFolders(this.user);
this.initMainNav();

this.connector.scope = this.isSafe ? RestConstants.SAFE_SCOPE : null;
this.isLoggedIn = true;
Expand Down Expand Up @@ -521,8 +522,6 @@ export class WorkspaceMainComponent implements EventListener, OnInit, OnDestroy
}
this.mainnav = params.mainnav === 'false' ? false : true;

this.initMainNav();

if (params.file && params.file !== this.oldParams?.file) {
void this.showNodeInCurrentFolder(params.file);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ security {
useHomeApplicationKeys: false
idp: {
metadata: {
url: "http://idp/metadata.xml"
url: "http://idp/metadata.xml"
// content: """..."""
// filePath: /tmp/metadata.xml
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions config/defaults/src/main/resources/metadatasets/xml/mds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,9 @@
{"bool":{
"must":[
{"term":{"nodeRef.storeRef.protocol":"workspace"}}
],
"must_not":[
{"exists":{"field": "properties.ccm:published_original"}}
]
}}
</basequery>
Expand Down

0 comments on commit 6a7e084

Please sign in to comment.