Skip to content

Commit aa39a04

Browse files
committed
Merge remote-tracking branch 'bitbucket4science/dspace-cris-2024_02_x' into dspace-cris-2024_02_x
2 parents c89ce27 + 529c632 commit aa39a04

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

dspace-server-webapp/src/test/java/org/dspace/app/rest/BitstreamRestControllerIT.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
import org.dspace.content.Item;
8888
import org.dspace.content.service.BitstreamFormatService;
8989
import org.dspace.content.service.BitstreamService;
90-
import org.dspace.content.service.CollectionService;
9190
import org.dspace.core.Constants;
9291
import org.dspace.disseminate.CitationDocumentServiceImpl;
9392
import org.dspace.eperson.EPerson;
@@ -105,7 +104,6 @@
105104
import org.junit.Test;
106105
import org.mockito.Mockito;
107106
import org.springframework.beans.factory.annotation.Autowired;
108-
import org.springframework.context.ApplicationContext;
109107
import org.springframework.test.util.ReflectionTestUtils;
110108
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
111109

@@ -139,18 +137,9 @@ public class BitstreamRestControllerIT extends AbstractControllerIntegrationTest
139137
@Autowired
140138
private AuthorizeService authorizeService;
141139

142-
@Autowired
143-
private CollectionService collectionService;
144-
145140
@Autowired
146141
private BitstreamStorageService bitstreamStorageService;
147142

148-
@Autowired
149-
private S3BitStoreService s3BitStoreService;
150-
151-
@Autowired
152-
private ApplicationContext applicationContext;
153-
154143
// S3Mock related fields for integration testing
155144
private S3Mock s3Mock;
156145
private AmazonS3 amazonS3Client;

dspace/config/modules/assetstore.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,9 @@ assetstore.s3.endpoint =
7070
# session token
7171
assetstore.s3.awsToken =
7272

73+
assetstore.s3.temp.enabled = false
74+
assetstore.s3.temp.bucketName =
75+
assetstore.s3.temp.subfolder =
76+
7377
# Pre-signed URL expiration time in seconds (default is 15 minutes)
7478
# assetstore.s3.presigned.url.expiration.seconds =

dspace/config/spring/api/bitstore.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<map>
1010
<entry key="0" value-ref="localStore"/>
1111
<entry key="1" value-ref="s3Store"/>
12+
<entry key="2" value-ref="s3TempStore"/>
1213
</map>
1314
</property>
1415
</bean>
@@ -40,6 +41,29 @@
4041
<property name="endpoint" value="${assetstore.s3.endpoint}"/>
4142
</bean>
4243

44+
<bean name="s3TempStore" class="org.dspace.storage.bitstore.S3BitStoreService" scope="singleton" lazy-init="true">
45+
<property name="enabled" value="${assetstore.s3.temp.enabled}"/>
46+
<!-- AWS Security credentials, with policies for specified bucket -->
47+
<property name="awsAccessKey" value="${assetstore.s3.awsAccessKey}"/>
48+
<property name="awsSecretKey" value="${assetstore.s3.awsSecretKey}"/>
49+
<property name="awsSessionToken" value="${assetstore.s3.awsToken}"/>
50+
<property name="useRelativePath" value="${assetstore.s3.useRelativePath}"/>
51+
52+
<!-- S3 bucket name to store assets in. example: longsight-dspace-auk -->
53+
<property name="bucketName" value="${assetstore.s3.temp.bucketName}"/>
54+
55+
<!-- AWS S3 Region to use: {us-east-1, us-west-1, eu-west-1, eu-central-1, ap-southeast-1, ... } -->
56+
<!-- Optional, sdk default is us-east-1 -->
57+
<property name="awsRegionName" value="${assetstore.s3.awsRegionName}"/>
58+
59+
<!-- Subfolder to organize assets within the bucket, in case this bucket is shared -->
60+
<!-- Optional, default is root level of bucket -->
61+
<property name="subfolder" value="${assetstore.s3.temp.subfolder}"/>
62+
<property name="maxConnections" value="${assetstore.s3.maxConnections}"/>
63+
<property name="connectionTimeout" value="${assetstore.s3.connectionTimeout}"/>
64+
<property name="endpoint" value="${assetstore.s3.endpoint}"/>
65+
</bean>
66+
4367
<!-- <bean name="localStore2 ... -->
4468
<!-- <bean name="s3Store2 ... -->
4569
</beans>

0 commit comments

Comments
 (0)