Skip to content

Commit

Permalink
Upgrade a few pinned dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jianglai committed Mar 9, 2024
1 parent 34a8a94 commit bc5eaf0
Show file tree
Hide file tree
Showing 21 changed files with 171 additions and 144 deletions.
6 changes: 3 additions & 3 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ dependencies {
testImplementation deps['org.apache.sshd:sshd-scp']
testImplementation deps['org.apache.sshd:sshd-sftp']
testImplementation deps['org.apache.tomcat:tomcat-annotations-api']
implementation deps['org.bouncycastle:bcpg-jdk15on']
implementation deps['org.bouncycastle:bcpkix-jdk15on']
implementation deps['org.bouncycastle:bcprov-jdk15on']
implementation deps['org.bouncycastle:bcpg-jdk18on']
implementation deps['org.bouncycastle:bcpkix-jdk18on']
implementation deps['org.bouncycastle:bcprov-jdk18on']
testImplementation deps['com.fasterxml.jackson.core:jackson-databind']
implementation deps['org.hibernate:hibernate-core']
implementation deps['org.hibernate:hibernate-hikaricp']
Expand Down
27 changes: 15 additions & 12 deletions core/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,16 @@ com.google.apis:google-api-services-gmail:v1-rev20220404-2.0.0=compileClasspath,
com.google.apis:google-api-services-groupssettings:v1-rev20210624-2.0.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.apis:google-api-services-healthcare:v1-rev20240110-2.0.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.apis:google-api-services-iamcredentials:v1-rev20211203-2.0.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.apis:google-api-services-monitoring:v3-rev20240128-2.0.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.apis:google-api-services-monitoring:v3-rev20240303-2.0.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.apis:google-api-services-pubsub:v1-rev20220904-2.0.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.apis:google-api-services-sheets:v4-rev20230815-2.0.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.apis:google-api-services-sqladmin:v1beta4-rev20240205-2.0.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.apis:google-api-services-storage:v1-rev20240209-2.0.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.appengine:appengine-api-1.0-sdk:1.9.86=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath
com.google.appengine:appengine-api-1.0-sdk:2.0.25=testCompileClasspath,testRuntimeClasspath
com.google.appengine:appengine-api-stubs:2.0.25=testCompileClasspath,testRuntimeClasspath
com.google.appengine:appengine-testing:1.9.86=deploy_jar,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.appengine:appengine-api-1.0-sdk:2.0.25=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.appengine:appengine-api-stubs:2.0.25=deploy_jar,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.appengine:appengine-remote-api:2.0.25=deploy_jar,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.appengine:appengine-testing:2.0.25=deploy_jar,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.appengine:appengine-tools-sdk:2.0.25=deploy_jar,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.auth:google-auth-library-credentials:1.23.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.auth:google-auth-library-oauth2-http:1.23.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.auto.service:auto-service-annotations:1.0.1=errorprone,nonprodAnnotationProcessor,testAnnotationProcessor
Expand Down Expand Up @@ -371,14 +372,16 @@ org.apache.ftpserver:ftpserver-core:1.2.0=testCompileClasspath,testRuntimeClassp
org.apache.httpcomponents:httpclient:4.5.14=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpcore:4.4.16=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.mina:mina-core:2.1.6=testCompileClasspath,testRuntimeClasspath
org.apache.sshd:sshd-core:2.0.0=testCompileClasspath,testRuntimeClasspath
org.apache.sshd:sshd-scp:2.0.0=testCompileClasspath,testRuntimeClasspath
org.apache.sshd:sshd-sftp:2.0.0=testCompileClasspath,testRuntimeClasspath
org.apache.sshd:sshd-common:2.12.1=testCompileClasspath,testRuntimeClasspath
org.apache.sshd:sshd-core:2.12.1=testCompileClasspath,testRuntimeClasspath
org.apache.sshd:sshd-scp:2.12.1=testCompileClasspath,testRuntimeClasspath
org.apache.sshd:sshd-sftp:2.12.1=testCompileClasspath,testRuntimeClasspath
org.apache.tomcat:tomcat-annotations-api:11.0.0-M17=testCompileClasspath,testRuntimeClasspath
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath
org.bouncycastle:bcpg-jdk15on:1.67=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.bouncycastle:bcpkix-jdk15on:1.67=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.bouncycastle:bcprov-jdk15on:1.67=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.bouncycastle:bcpg-jdk18on:1.77=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.bouncycastle:bcpkix-jdk18on:1.77=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.bouncycastle:bcprov-jdk18on:1.77=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.bouncycastle:bcutil-jdk18on:1.77=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.checkerframework:checker-compat-qual:2.5.3=compileClasspath,nonprodCompileClasspath,testCompileClasspath
org.checkerframework:checker-compat-qual:2.5.5=annotationProcessor,testAnnotationProcessor
org.checkerframework:checker-compat-qual:2.5.6=deploy_jar,nonprodRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
Expand Down Expand Up @@ -489,7 +492,7 @@ org.seleniumhq.selenium:selenium-opera-driver:3.141.59=testCompileClasspath,test
org.seleniumhq.selenium:selenium-remote-driver:3.141.59=testCompileClasspath,testRuntimeClasspath
org.seleniumhq.selenium:selenium-safari-driver:3.141.59=testCompileClasspath,testRuntimeClasspath
org.seleniumhq.selenium:selenium-support:3.141.59=testCompileClasspath,testRuntimeClasspath
org.slf4j:jcl-over-slf4j:1.7.30=testRuntimeClasspath
org.slf4j:jcl-over-slf4j:1.7.32=testCompileClasspath,testRuntimeClasspath
org.slf4j:jul-to-slf4j:1.7.30=testRuntimeClasspath
org.slf4j:slf4j-api:2.0.12=compileClasspath,nonprodCompileClasspath,nonprodRuntimeClasspath,testCompileClasspath
org.slf4j:slf4j-api:2.1.0-alpha1=deploy_jar,runtimeClasspath,testRuntimeClasspath
Expand Down
22 changes: 9 additions & 13 deletions core/src/main/java/google/registry/keyring/api/PgpHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,17 @@ public static PGPPublicKey loadPublicKeyBytes(byte[] data) {
*/
public static PGPPublicKey lookupPublicKey(
PGPPublicKeyRingCollection keyring, String query, KeyRequirement want) {
try {
Iterator<PGPPublicKeyRing> results =
keyring.getKeyRings(checkNotNull(query, "query"), true, true);
verify(results.hasNext(), "No public key found matching substring: %s", query);
while (results.hasNext()) {
Optional<PGPPublicKey> result = lookupPublicSubkey(results.next(), want);
if (result.isPresent()) {
return result.get();
}
Iterator<PGPPublicKeyRing> results =
keyring.getKeyRings(checkNotNull(query, "query"), true, true);
verify(results.hasNext(), "No public key found matching substring: %s", query);
while (results.hasNext()) {
Optional<PGPPublicKey> result = lookupPublicSubkey(results.next(), want);
if (result.isPresent()) {
return result.get();
}
throw new VerifyException(String.format(
"No public key (%s) found matching substring: %s", want, query));
} catch (PGPException e) {
throw new VerifyException(String.format("Public key lookup failed for query: %s", query), e);
}
throw new VerifyException(
String.format("No public key (%s) found matching substring: %s", want, query));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
import schemacrawler.tools.options.OutputOptionsBuilder;

/** Command to generate ER diagrams for SQL schema. */
@Parameters(separators = " =", commandDescription = "Generate ER diagrams for SQL schmea.")
@Parameters(separators = " =", commandDescription = "Generate ER diagrams for SQL schema.")
public class GenerateSqlErDiagramCommand implements Command {

private static final String DB_NAME = "postgres";
Expand Down Expand Up @@ -101,31 +101,29 @@ public void run() throws Exception {
checkState(outDir.toFile().mkdirs(), "Failed to create directory %s", outDir);
}

PostgreSQLContainer postgresContainer =
new PostgreSQLContainer(NomulusPostgreSql.getDockerTag())
.withDatabaseName(DB_NAME)
.withUsername(DB_USER)
.withPassword(DB_PASSWORD);
postgresContainer.start();

try (Connection conn = getConnection(postgresContainer)) {
try (PostgreSQLContainer<?> postgresContainer =
new PostgreSQLContainer<>(NomulusPostgreSql.getDockerTag())) {
postgresContainer
.withDatabaseName(DB_NAME)
.withUsername(DB_USER)
.withPassword(DB_PASSWORD)
.start();
Connection conn = getConnection(postgresContainer);
initDb(conn);
if (diagramType == ALL || diagramType == FULL) {
improveDiagramHtml(generateErDiagram(conn, FULL_DIAGRAM_COMMAND, FULL_DIAGRAM_FILE_NAME));
}
if (diagramType == ALL || diagramType == BRIEF) {
improveDiagramHtml(generateErDiagram(conn, BRIEF_DIAGRAM_COMMAND, BRIEF_DIAGRAM_FILE_NAME));
}
} finally {
postgresContainer.stop();
}
}

private void improveDiagramHtml(Path diagram) {
try {
Document doc = Jsoup.parse(diagram.toFile(), StandardCharsets.UTF_8.name());

// Add the last name of the flyway file to the HTML so we can have a test to verify that if
// Add the last name of the flyway file to the HTML, so we can have a test to verify that if
// the generated diagram is up to date.
doc.select("body > table > tbody")
.first()
Expand All @@ -140,11 +138,9 @@ private void improveDiagramHtml(Path diagram) {
+ "</tr>");

// Add pan and zoom support for the embedded SVG in the HTML.
StringBuilder svgPanZoomLib =
new StringBuilder("<script>")
.append(ResourceUtils.readResourceUtf8(SVG_PAN_ZOOM_LIB))
.append("</script>");
doc.select("head").first().append(svgPanZoomLib.toString());
String svgPanZoomLib =
"<script>" + ResourceUtils.readResourceUtf8(SVG_PAN_ZOOM_LIB) + "</script>";
doc.select("head").first().append(svgPanZoomLib);
doc.select("svg")
.first()
.attributes()
Expand All @@ -163,8 +159,7 @@ private void improveDiagramHtml(Path diagram) {
+ "});"
+ "</script>");

Files.write(
diagram, doc.outerHtml().getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE);
Files.writeString(diagram, doc.outerHtml(), StandardOpenOption.WRITE);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
Expand Down Expand Up @@ -194,7 +189,7 @@ private Path generateErDiagram(Connection connection, String command, String fil
return outputFile;
}

private static Connection getConnection(PostgreSQLContainer container) {
private static Connection getConnection(PostgreSQLContainer<?> container) {
Properties info = new Properties();
info.put("user", container.getUsername());
info.put("password", container.getPassword());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,17 @@
import javax.annotation.Nullable;
import org.apache.ftpserver.FtpServer;
import org.apache.ftpserver.ftplet.FtpException;
import org.apache.sshd.common.NamedFactory;
import org.apache.sshd.common.file.virtualfs.VirtualFileSystemFactory;
import org.apache.sshd.common.keyprovider.KeyPairProvider;
import org.apache.sshd.common.random.SingletonRandomFactory;
import org.apache.sshd.common.session.SessionContext;
import org.apache.sshd.scp.server.ScpCommandFactory;
import org.apache.sshd.server.ServerBuilder;
import org.apache.sshd.server.SshServer;
import org.apache.sshd.server.auth.password.PasswordAuthenticator;
import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator;
import org.apache.sshd.server.command.Command;
import org.apache.sshd.server.scp.ScpCommandFactory;
import org.apache.sshd.server.session.ServerSession;
import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory;
import org.apache.sshd.sftp.server.SftpSubsystemFactory;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openssl.PEMKeyPair;
import org.bouncycastle.openssl.PEMParser;
Expand Down Expand Up @@ -131,7 +130,7 @@ public boolean authenticate(
server.setCommandFactory(new ScpCommandFactory());
server.setPort(port);

NamedFactory<Command> sftpSubsystemFactory = new SftpSubsystemFactory.Builder().build();
SftpSubsystemFactory sftpSubsystemFactory = new SftpSubsystemFactory.Builder().build();
server.setSubsystemFactories(ImmutableList.of(sftpSubsystemFactory));

if (authorizedPassword != null) {
Expand All @@ -150,17 +149,17 @@ public boolean authenticate(String username, String password, ServerSession sess
ImmutableMap.of(KEY_TYPE, HOST_KEY_PAIR);

@Override
public Iterable<KeyPair> loadKeys() {
public Iterable<KeyPair> loadKeys(SessionContext context) {
return keyPairByTypeMap.values();
}

@Override
public Iterable<String> getKeyTypes() {
public Iterable<String> getKeyTypes(SessionContext context) {
return keyPairByTypeMap.keySet();
}

@Override
public KeyPair loadKey(final String type) {
public KeyPair loadKey(SessionContext context, final String type) {
return keyPairByTypeMap.get(type);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class GenerateSqlErDiagramCommandTest extends CommandTestCase<GenerateSqlErDiagr

@Test
void testSchemaGeneration() throws Exception {
runCommand("--out_dir=" + tmpDir.resolve("diagram").toString());
runCommand("--out_dir=" + tmpDir.resolve("diagram"));

Path fullDiagram = tmpDir.resolve("diagram/full_er_diagram.html");
Document fullDiagramDoc = Jsoup.parse(fullDiagram.toFile(), StandardCharsets.UTF_8.name());
Expand Down
42 changes: 20 additions & 22 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,43 +47,34 @@ ext {
'com.thoughtworks.qdox:qdox:1.12.1',
'jline:jline:1.0',

// Breaking change causing soy template parsing error.
// Remove after the legacy console is deleted.
'com.google.template:soy:2021-02-01',
'com.google.protobuf:protobuf-java:3.13.0',
'com.google.javascript:closure-compiler:v20210505',
'com.google.closure-stylesheets:closure-stylesheets:1.5.0',

// Our .xjb files are not compatible with newer binding specs: some
// xml elements' names have changed.
'com.sun.xml.bind:jaxb-xjc:2.3.3',

// appengine-api-1.0-sdk has breaking changes.
'com.google.appengine:appengine-api-1.0-sdk:1.9.86',

// Pin-breakers for appengine-api-1.0-sdk
'com.google.appengine:appengine-testing:1.9.86',

// Pinned for gwt-user.
'com.google.javascript:closure-compiler:v20210505',
'com.google.closure-stylesheets:closure-stylesheets:1.5.0',

// Dependency groups with inconsistent version.
'org.apache.sshd:sshd-core:2.0.0',
'org.apache.sshd:sshd-scp:2.0.0',
'org.apache.sshd:sshd-sftp:2.0.0',
'org.bouncycastle:bcpg-jdk15on:1.67',
'org.bouncycastle:bcpkix-jdk15on:1.67',
'org.bouncycastle:bcprov-jdk15on:1.67',

'org.seleniumhq.selenium:selenium-api:3.141.59',
'org.seleniumhq.selenium:selenium-chrome-driver:3.141.59',
'org.seleniumhq.selenium:selenium-java:3.141.59',
'org.seleniumhq.selenium:selenium-remote-driver:3.141.59',
'us.fatehi:schemacrawler:16.10.1',
'us.fatehi:schemacrawler-api:16.10.1',
'us.fatehi:schemacrawler-diagram:16.10.1',
'us.fatehi:schemacrawler-tools:16.10.1',


// CAPPED VERSIONS START HERE.

// Schema crawler 16.11+ breaks API and tries to register a SQL driver
// referenced (but not provided) by appengine-api-1.0-sdk.
// Try upgrading to the latest version after we are off GAE.
'us.fatehi:schemacrawler:[16.10.1, 16.11.0)!!',
'us.fatehi:schemacrawler-api:[16.10.1, 16.11.0)!!',
'us.fatehi:schemacrawler-diagram:[16.10.1, 16.11.0)!!',
'us.fatehi:schemacrawler-tools:[16.10.1, 16.11.0)!!',

// Hibernate 6.0+ requires Jakarta EE.
'org.hibernate:hibernate-core:[5.6.14.Final, 6.0)',
'org.hibernate:hibernate-hikaricp:[5.6.14.Final, 6.0)',
Expand All @@ -109,7 +100,6 @@ ext {


// DYNAMIC VERSIONS START HERE.

'args4j:args4j:[2.0.26,)',
'com.fasterxml.jackson.core:jackson-databind:[2.11.2,)',
'com.github.ben-manes.caffeine:caffeine:[3.0.0,)',
Expand All @@ -125,7 +115,9 @@ ext {
'com.google.apis:google-api-services-monitoring:[v3-rev540-1.25.0,)',
'com.google.apis:google-api-services-sheets:[v4-rev612-1.25.0,)',
'com.google.apis:google-api-services-storage:[v1-rev20210127-1.31.0,)',
'com.google.appengine:appengine-api-1.0-sdk:[1.9.86,)',
'com.google.appengine:appengine-api-stubs:[1.9.86,)',
'com.google.appengine:appengine-testing:[1.9.86,)',
'com.google.auth:google-auth-library-credentials:[0.24.1,)',
'com.google.auth:google-auth-library-oauth2-http:[0.24.1,)',
'com.google.auto.service:auto-service-annotations:[1.0-rc7,)',
Expand Down Expand Up @@ -203,7 +195,13 @@ ext {
'org.apache.ftpserver:ftpserver-core:[1.0.6,)',
'org.apache.httpcomponents:httpclient:[4.5.11,)',
'org.apache.httpcomponents:httpcore:[4.4.13,)',
'org.apache.sshd:sshd-core:[2.0.0,)',
'org.apache.sshd:sshd-scp:[2.0.0,)',
'org.apache.sshd:sshd-sftp:[2.0.0,)',
'org.apache.tomcat:tomcat-annotations-api:[8.0.5,)',
'org.bouncycastle:bcpg-jdk18on:[1.67,)',
'org.bouncycastle:bcpkix-jdk18on:[1.67,)',
'org.bouncycastle:bcprov-jdk18on:[1.67,)',
'org.checkerframework:checker-compat-qual:[2.5.5,)',
'org.checkerframework:checker-qual:[3.9.1,)',
'org.eclipse.jetty:jetty-server:[9.4.49.v20220914,)',
Expand Down
Loading

0 comments on commit bc5eaf0

Please sign in to comment.