Skip to content

Commit

Permalink
SHIBUI-2584
Browse files Browse the repository at this point in the history
Merge develop to working branch
  • Loading branch information
chasegawa committed Jul 13, 2023
2 parents 1aae6c2 + 4711ada commit d5ed2ff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public Instant getValidUntil() {

@Override
public void setValidUntil(Instant validUntilInstant) {
this.validUntil = LocalDateTime.ofInstant(validUntilInstant, ZoneOffset.UTC);
this.validUntil = validUntilInstant == null ? null : LocalDateTime.ofInstant(validUntilInstant, ZoneOffset.UTC);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.opensaml.xmlsec.signature.KeyName;
import org.opensaml.xmlsec.signature.KeyValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
Expand Down Expand Up @@ -95,6 +96,9 @@ public class JPAEntityDescriptorServiceImpl implements EntityDescriptorService {
@Autowired
private UserService userService;

@Value("${shibui.remove.EntityDescriptor.validUntil:true}")
private Boolean removeValidUntil;

private EntityDescriptor buildDescriptorFromRepresentation(final EntityDescriptor ed, final EntityDescriptorRepresentation representation) {
ed.setEntityID(representation.getEntityId());
ed.setIdOfOwner(representation.getIdOfOwner());
Expand Down Expand Up @@ -282,6 +286,11 @@ public EntityDescriptorRepresentation createNewEntityDescriptorFromXMLOrigin(Ent
userService.getCurrentUserGroup().getApproversList().isEmpty()) {
ed.setApproved(true);
}

if (removeValidUntil) {
ed.setValidUntil(null);
}

EntityDescriptor savedEntity = entityDescriptorRepository.save(ed);
beaconDataService.addBeaconEvent(new BeaconEvent(BeaconEventType.METADATA_SOURCE_CREATED));
return createRepresentationFromDescriptor(savedEntity);
Expand Down
3 changes: 3 additions & 0 deletions backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,8 @@ management.server.port=9090
management.endpoints.web.cors.allowed-origins=*
management.endpoints.web.cors.allowed-headers=*

### Lucene temp dir location to use
shibui.lucene.dir=/var/tmp/shibui-cache

# When true, this will remove the validUntil attribute for an EntityDescriptor uploaded from XML source, only set to false if you want the XML uploaded as is
# shibui.remove.EntityDescriptor.validUntil=true

0 comments on commit d5ed2ff

Please sign in to comment.