Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies to latest versions #100

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pass-core-doi-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>${javax.json.version}</version>
<artifactId>jakarta.json</artifactId>
<version>${jakarta.json.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.json.JsonArray;
import javax.json.JsonObject;

import com.yahoo.elide.RefreshableElide;
import jakarta.json.JsonArray;
import jakarta.json.JsonObject;
import org.eclipse.pass.object.PassClient;
import org.eclipse.pass.object.PassClientResult;
import org.eclipse.pass.object.PassClientSelector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.json.JsonObject;

import jakarta.json.JsonObject;

/**
* ExternalDoiService classes provide configuration needed for specific implementations'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
import java.io.IOException;
import java.io.StringReader;
import java.util.Objects;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonReader;
import javax.json.stream.JsonParsingException;

import jakarta.json.Json;
import jakarta.json.JsonObject;
import jakarta.json.JsonReader;
import jakarta.json.stream.JsonParsingException;
import okhttp3.Call;
import okhttp3.Headers;
import okhttp3.HttpUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

import java.io.IOException;
import java.io.OutputStream;
import javax.json.Json;
import javax.json.JsonObject;

import com.yahoo.elide.RefreshableElide;
import jakarta.json.Json;
import jakarta.json.JsonObject;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonArrayBuilder;
import javax.json.JsonObject;
import javax.json.JsonValue;

import jakarta.json.Json;
import jakarta.json.JsonArray;
import jakarta.json.JsonArrayBuilder;
import jakarta.json.JsonObject;
import jakarta.json.JsonValue;

/**
* The UnpaywallDoiService class is an implementation of the ExternalDoiService abstract class to interface with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
package org.eclipse.pass.doi.service;

import java.util.HashMap;
import javax.json.JsonObject;

import jakarta.json.JsonObject;

/**
* The XrefDoiService class is an implementation of the ExternalDoiService abstract class to interface with the Crossref
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.StringReader;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonReader;

import com.yahoo.elide.RefreshableElide;
import jakarta.json.Json;
import jakarta.json.JsonObject;
import jakarta.json.JsonReader;
import org.eclipse.pass.object.model.Journal;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import javax.json.JsonObject;

import jakarta.json.JsonObject;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
package org.eclipse.pass.doi.service;

import java.io.StringReader;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonReader;

import jakarta.json.Json;
import jakarta.json.JsonObject;
import jakarta.json.JsonReader;

/**
* A utility class to provide real-life json responses
Expand Down
1 change: 0 additions & 1 deletion pass-core-file-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${apache.commons.io.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
import org.springframework.context.annotation.Configuration;
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.S3ClientBuilder;
import software.amazon.awssdk.services.s3.S3AsyncClient;
import software.amazon.awssdk.services.s3.S3AsyncClientBuilder;
import software.amazon.awssdk.services.s3.model.CreateBucketRequest;
import software.amazon.awssdk.transfer.s3.S3TransferManager;

/**
* The StorageConfiguration is responsible for handling the StorageProperties. The FileStorageService does not get the
Expand All @@ -60,35 +61,50 @@ public class StorageConfiguration {

@Bean
@ConditionalOnProperty(name = "pass.file-service.storage-type", havingValue = "S3")
public S3Client s3Client(StorageProperties storageProperties) throws IOException {
public S3TransferManager s3TransferManager() {
S3AsyncClient s3AsyncClient = S3AsyncClient.crtBuilder()
.credentialsProvider(DefaultCredentialsProvider.create())
.region(Region.of(awsRegion))
.build();

return S3TransferManager.builder()
.s3Client(s3AsyncClient)
.build();
}

@Bean
@ConditionalOnProperty(name = "pass.file-service.storage-type", havingValue = "S3")
public S3AsyncClient s3Client(StorageProperties storageProperties) throws IOException {
String bucketName = storageProperties.getBucketName().
orElseThrow(() -> new IOException("File Service: S3 bucket name is not set"));

S3ClientBuilder builder = S3Client.builder()
S3AsyncClientBuilder builder = S3AsyncClient.builder()
.credentialsProvider(DefaultCredentialsProvider.create())
.region(Region.of(awsRegion));

String endpoint = storageProperties.getS3Endpoint().orElse(null);
S3Client s3Client = StringUtils.isNotBlank(endpoint)
S3AsyncClient s3Client = StringUtils.isNotBlank(endpoint)
? builder.endpointOverride(URI.create(endpoint)).forcePathStyle(true).build()
: builder.build();

if (s3Client.listBuckets().buckets().stream().noneMatch(b -> b.name().equals(bucketName))) {
if (s3Client.listBuckets().join().buckets().stream().noneMatch(b -> b.name().equals(bucketName))) {
s3Client.createBucket(CreateBucketRequest.builder().bucket(bucketName).build());
}
return s3Client;
}

@Bean
@ConditionalOnProperty(name = "pass.file-service.storage-type", havingValue = "S3")
public OcflRepository ocflS3Repository(S3Client s3Client, StorageProperties storageProperties,
public OcflRepository ocflS3Repository(S3AsyncClient s3Client, S3TransferManager s3TransferManager,
StorageProperties storageProperties,
@Qualifier("rootPath") Path rootLoc) throws IOException {
String bucketName = storageProperties.getBucketName().
orElseThrow(() -> new IOException("File Service: S3 bucket name is not set"));
String repoPrefix = storageProperties.getS3RepoPrefix().orElse(null);

OcflS3Client.Builder builder = OcflS3Client.builder()
.s3Client(s3Client)
.transferManager(s3TransferManager)
.bucket(bucketName);
OcflS3Client ocflS3Client = StringUtils.isNotBlank(repoPrefix)
? builder.repoPrefix(repoPrefix).build()
Expand Down
2 changes: 1 addition & 1 deletion pass-core-main/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17.0.8_7-jre-jammy
FROM eclipse-temurin:17.0.13_11-jre-jammy

WORKDIR /app

Expand Down
7 changes: 0 additions & 7 deletions pass-core-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,16 @@
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>${liquibase.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -175,7 +169,6 @@
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>${rest-assured.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import java.util.HashMap;
import java.util.Objects;
import java.util.Set;
import javax.json.Json;
import javax.json.JsonObjectBuilder;

import com.amazon.sqs.javamessaging.ProviderConfiguration;
import com.amazon.sqs.javamessaging.SQSConnectionFactory;
Expand All @@ -38,6 +36,8 @@
import com.yahoo.elide.jsonapi.JsonApiSettingsBuilderCustomizer;
import jakarta.jms.ConnectionFactory;
import jakarta.jms.TextMessage;
import jakarta.json.Json;
import jakarta.json.JsonObjectBuilder;
import jakarta.persistence.OptimisticLockException;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.pass.main.repository.DepositRepository;
Expand Down Expand Up @@ -178,7 +178,7 @@ public EntityDictionary buildDictionary(Injector injector, ClassScanner scanner,
DepositRepository depositRepository) {

EntityDictionary dictionary = new EntityDictionary(new HashMap<>(), new HashMap<>(), injector,
CoerceUtil::lookup, entitiesToExclude, scanner);
CoerceUtil::lookup, entitiesToExclude, scanner, null);

setupHooks(dictionary, jms, userTokenFactory, submissionRepository, depositRepository);

Expand Down
18 changes: 18 additions & 0 deletions pass-core-main/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ elide:
spring:
application:
name: pass-core
cloud:
aws:
cloudwatch:
enabled: false
dynamodb:
enabled: false
parameterstore:
enabled: false
s3:
enabled: false
secretsmanager:
enabled: false
ses:
enabled: false
sns:
enabled: false
sqs:
enabled: false
jpa:
properties:
hibernate:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

import java.io.IOException;
import java.io.StringReader;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonReader;

import com.yahoo.elide.RefreshableElide;
import jakarta.json.Json;
import jakarta.json.JsonObject;
import jakarta.json.JsonReader;
import okhttp3.Call;
import okhttp3.Credentials;
import okhttp3.HttpUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = {
"spring.cloud.aws.parameterstore.enabled=true",
"spring.cloud.aws.credentials.access-key=noop",
"spring.cloud.aws.credentials.secret-key=noop",
"spring.cloud.aws.region.static=us-east-1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
import java.net.URI;
import java.util.Collections;
import java.util.Enumeration;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.stream.JsonParser;
import javax.json.stream.JsonParser.Event;

import com.yahoo.elide.RefreshableElide;
import jakarta.jms.JMSException;
import jakarta.jms.QueueBrowser;
import jakarta.jms.Session;
import jakarta.jms.TextMessage;
import jakarta.json.Json;
import jakarta.json.JsonObject;
import jakarta.json.stream.JsonParser;
import jakarta.json.stream.JsonParser.Event;
import org.eclipse.pass.object.ElidePassClient;
import org.eclipse.pass.object.PassClient;
import org.eclipse.pass.object.model.Deposit;
Expand Down
4 changes: 2 additions & 2 deletions pass-core-policy-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>${javax.json.version}</version>
<artifactId>jakarta.json</artifactId>
<version>${jakarta.json.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
import java.nio.charset.StandardCharsets;
import java.security.Principal;
import java.util.Set;
import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonArrayBuilder;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;

import com.yahoo.elide.RefreshableElide;
import jakarta.json.Json;
import jakarta.json.JsonArray;
import jakarta.json.JsonArrayBuilder;
import jakarta.json.JsonObject;
import jakarta.json.JsonObjectBuilder;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.eclipse.pass.object.model.Policy;
Expand Down
6 changes: 3 additions & 3 deletions pass-core-user-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
</dependency>

<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>${javax.json.version}</version>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>${jakarta.json.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.security.Principal;
import javax.json.Json;
import javax.json.JsonObject;

import com.yahoo.elide.RefreshableElide;
import jakarta.json.Json;
import jakarta.json.JsonObject;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.eclipse.pass.object.PassClient;
Expand Down
Loading
Loading