mirror of
https://github.com/google/nomulus
synced 2026-08-10 09:16:12 +00:00
Compare commits
13
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bba5aff4b6 | ||
|
|
df7d272157 | ||
|
|
988f78274e | ||
|
|
369c1259fb | ||
|
|
1e1c8cdd80 | ||
|
|
3d3d390a9f | ||
|
|
f0fc53e035 | ||
|
|
c156842844 | ||
|
|
c584de9f72 | ||
|
|
9be5091c84 | ||
|
|
28499d23a0 | ||
|
|
961d7e88f4 | ||
|
|
215de62fa7 |
@@ -81,7 +81,7 @@ appengine {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(':core')
|
||||
compile project(path: ':core', configuration: 'deploy_jar')
|
||||
}
|
||||
|
||||
// The tools.jar file gets pulled in from the java environment and for some
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
aopalliance:aopalliance:1.0
|
||||
args4j:args4j:2.0.23
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.27.0
|
||||
com.google.api.grpc:proto-google-common-protos:1.12.0
|
||||
com.google.api.grpc:proto-google-iam-v1:0.12.0
|
||||
com.google.api:api-common:1.7.0
|
||||
com.google.api:gax-httpjson:0.52.1
|
||||
com.google.api:gax:1.35.1
|
||||
com.google.apis:google-api-services-storage:v1-rev20181013-1.27.0
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.cloud:google-cloud-core-http:1.59.0
|
||||
com.google.cloud:google-cloud-core:1.59.0
|
||||
com.google.cloud:google-cloud-storage:1.59.0
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.code.gson:gson:2.7
|
||||
com.google.common.html.types:types:1.0.4
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.0-beta1
|
||||
com.google.http-client:google-http-client-appengine:1.27.0
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.oauth-client:google-oauth-client:1.27.0
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
com.google.template:soy:2018-03-14
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.annotation:javax.annotation-api:1.2
|
||||
javax.annotation:jsr250-api:1.0
|
||||
javax.inject:javax.inject:1
|
||||
javax.validation:validation-api:1.0.0.GA
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.commons:commons-lang3:3.8.1
|
||||
org.apache.commons:commons-text:1.6
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.json:json:20160212
|
||||
org.ow2.asm:asm-analysis:6.0
|
||||
org.ow2.asm:asm-commons:6.0
|
||||
org.ow2.asm:asm-tree:6.0
|
||||
org.ow2.asm:asm-util:6.0
|
||||
org.ow2.asm:asm:6.0
|
||||
org.threeten:threetenbp:1.3.3
|
||||
@@ -0,0 +1,13 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
javax.inject:javax.inject:1
|
||||
joda-time:joda-time:2.9.2
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
+30
-1
@@ -12,6 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.lang.reflect.Constructor
|
||||
|
||||
plugins {
|
||||
id 'java-library'
|
||||
}
|
||||
@@ -660,6 +662,33 @@ task outcastTest(type: FilteringTest) {
|
||||
maxParallelForks 5
|
||||
}
|
||||
|
||||
// Whitebox test verifying that RegistryTool can be instantiated. Note the
|
||||
// use of runtimeClasspath. This test emulates the logic in RegistryCli#run.
|
||||
// A to-do is added there to refactor.
|
||||
// TODO(weiminyu): Need a similar test for Registry server.
|
||||
task registryToolIntegrationTest {
|
||||
dependsOn compileJava
|
||||
doLast {
|
||||
def classLoader =
|
||||
new URLClassLoader(sourceSets.main.runtimeClasspath.collect {
|
||||
it.toURI().toURL()
|
||||
} as URL[])
|
||||
def commandClasses =
|
||||
(classLoader.loadClass('google.registry.tools.RegistryTool')
|
||||
.getDeclaredField('COMMAND_MAP').get(null) as Map).values()
|
||||
|
||||
commandClasses.each {
|
||||
try {
|
||||
Constructor<?> c = ((Class<?>) it).getDeclaredConstructor()
|
||||
c.setAccessible(true)
|
||||
c.newInstance()
|
||||
} catch (Throwable e) {
|
||||
throw new RuntimeException("Failed to instantiate ${it}:\n ${e}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Dedicated test suite for schema-dependent tests.
|
||||
task sqlIntegrationTest(type: FilteringTest) {
|
||||
systemProperties project.getProperties().subMap('sql_schema_resource_root')
|
||||
@@ -779,7 +808,7 @@ test {
|
||||
// Don't run any tests from this task, all testing gets done in the
|
||||
// FilteringTest tasks.
|
||||
exclude "**"
|
||||
}.dependsOn(fragileTest, outcastTest, standardTest)
|
||||
}.dependsOn(fragileTest, outcastTest, standardTest, registryToolIntegrationTest)
|
||||
|
||||
createUberJar('nomulus', 'nomulus', 'google.registry.tools.RegistryTool')
|
||||
project.nomulus.dependsOn project(':third_party').jar
|
||||
|
||||
@@ -205,7 +205,6 @@ org.jetbrains:annotations:17.0.0
|
||||
org.joda:joda-money:1.0.1
|
||||
org.json:json:20160810
|
||||
org.jvnet.staxex:stax-ex:1.8
|
||||
org.mockito:mockito-core:1.9.5
|
||||
org.mortbay.jetty:jetty-util:6.1.26
|
||||
org.mortbay.jetty:jetty:6.1.26
|
||||
org.objenesis:objenesis:1.2
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
antlr:antlr:2.7.7
|
||||
aopalliance:aopalliance:1.0
|
||||
args4j:args4j:2.0.23
|
||||
cglib:cglib-nodep:2.2
|
||||
com.beust:jcommander:1.60
|
||||
com.fasterxml.jackson.core:jackson-annotations:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-databind:2.9.10
|
||||
com.fasterxml:classmate:1.3.4
|
||||
com.github.jnr:jffi:1.2.17
|
||||
com.github.jnr:jnr-a64asm:1.0.0
|
||||
com.github.jnr:jnr-constants:0.9.11
|
||||
com.github.jnr:jnr-enxio:0.19
|
||||
com.github.jnr:jnr-ffi:2.1.9
|
||||
com.github.jnr:jnr-posix:3.0.47
|
||||
com.github.jnr:jnr-unixsocket:0.21
|
||||
com.github.jnr:jnr-x86asm:1.0.2
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-pubsub-v1:1.43.0
|
||||
com.google.api.grpc:grpc-google-cloud-spanner-admin-database-v1:1.6.0
|
||||
com.google.api.grpc:grpc-google-cloud-spanner-admin-instance-v1:1.6.0
|
||||
com.google.api.grpc:grpc-google-cloud-spanner-v1:1.6.0
|
||||
com.google.api.grpc:grpc-google-common-protos:1.12.0
|
||||
com.google.api.grpc:proto-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:proto-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:proto-google-cloud-bigtable-v2:0.44.0
|
||||
com.google.api.grpc:proto-google-cloud-datastore-v1:0.44.0
|
||||
com.google.api.grpc:proto-google-cloud-pubsub-v1:1.43.0
|
||||
com.google.api.grpc:proto-google-cloud-spanner-admin-database-v1:1.6.0
|
||||
com.google.api.grpc:proto-google-cloud-spanner-admin-instance-v1:1.6.0
|
||||
com.google.api.grpc:proto-google-cloud-spanner-v1:1.6.0
|
||||
com.google.api.grpc:proto-google-common-protos:1.12.0
|
||||
com.google.api.grpc:proto-google-iam-v1:0.12.0
|
||||
com.google.api:api-common:1.7.0
|
||||
com.google.api:gax-grpc:1.38.0
|
||||
com.google.api:gax-httpjson:0.52.0
|
||||
com.google.api:gax:1.38.0
|
||||
com.google.apis:google-api-services-admin-directory:directory_v1-rev72-1.22.0
|
||||
com.google.apis:google-api-services-appengine:v1-rev101-1.25.0
|
||||
com.google.apis:google-api-services-bigquery:v2-rev20181104-1.27.0
|
||||
com.google.apis:google-api-services-clouddebugger:v2-rev20180801-1.27.0
|
||||
com.google.apis:google-api-services-cloudkms:v1-rev12-1.22.0
|
||||
com.google.apis:google-api-services-cloudresourcemanager:v1-rev20181015-1.27.0
|
||||
com.google.apis:google-api-services-dataflow:v1b3-rev20190607-1.27.0
|
||||
com.google.apis:google-api-services-dns:v2beta1-rev6-1.22.0
|
||||
com.google.apis:google-api-services-drive:v2-rev160-1.19.1
|
||||
com.google.apis:google-api-services-groupssettings:v1-rev60-1.22.0
|
||||
com.google.apis:google-api-services-monitoring:v3-rev426-1.23.0
|
||||
com.google.apis:google-api-services-pubsub:v1-rev20181105-1.27.0
|
||||
com.google.apis:google-api-services-sheets:v4-rev483-1.22.0
|
||||
com.google.apis:google-api-services-sqladmin:v1beta4-rev56-1.23.0
|
||||
com.google.apis:google-api-services-storage:v1-rev20181109-1.27.0
|
||||
com.google.appengine.tools:appengine-gcs-client:0.6
|
||||
com.google.appengine.tools:appengine-mapreduce:0.9
|
||||
com.google.appengine.tools:appengine-pipeline:0.2.13
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-remote-api:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.cloud.bigdataoss:gcsio:1.9.16
|
||||
com.google.cloud.bigdataoss:util:1.9.16
|
||||
com.google.cloud.bigtable:bigtable-client-core:1.8.0
|
||||
com.google.cloud.datastore:datastore-v1-proto-client:1.6.0
|
||||
com.google.cloud.sql:jdbc-socket-factory-core:1.0.12
|
||||
com.google.cloud.sql:postgres-socket-factory:1.0.12
|
||||
com.google.cloud:google-cloud-bigquerystorage:0.79.0-alpha
|
||||
com.google.cloud:google-cloud-bigtable-admin:0.73.0-alpha
|
||||
com.google.cloud:google-cloud-bigtable:0.73.0-alpha
|
||||
com.google.cloud:google-cloud-core-grpc:1.61.0
|
||||
com.google.cloud:google-cloud-core-http:1.55.0
|
||||
com.google.cloud:google-cloud-core:1.61.0
|
||||
com.google.cloud:google-cloud-spanner:1.6.0
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.code.gson:gson:2.8.5
|
||||
com.google.common.html.types:types:1.0.4
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.3
|
||||
com.google.flogger:flogger-system-backend:0.3.1
|
||||
com.google.flogger:flogger:0.3.1
|
||||
com.google.flogger:google-extensions:0.3.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
com.google.re2j:re2j:1.1
|
||||
com.google.template:soy:2018-03-14
|
||||
com.googlecode.charts4j:charts4j:1.3
|
||||
com.googlecode.json-simple:json-simple:1.1.1
|
||||
com.ibm.icu:icu4j:57.1
|
||||
com.jcraft:jsch:0.1.55
|
||||
com.kohlschutter.junixsocket:junixsocket-common:2.0.4
|
||||
com.kohlschutter.junixsocket:junixsocket-native-common:2.0.4
|
||||
com.squareup.okhttp:okhttp:2.5.0
|
||||
com.squareup.okio:okio:1.13.0
|
||||
com.sun.istack:istack-commons-runtime:3.0.7
|
||||
com.sun.xml.fastinfoset:FastInfoset:1.2.15
|
||||
com.thoughtworks.paranamer:paranamer:2.7
|
||||
com.zaxxer:HikariCP:3.2.0
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
dnsjava:dnsjava:2.1.7
|
||||
io.dropwizard.metrics:metrics-core:3.1.2
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-grpclb:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
io.grpc:grpc-netty:1.17.1
|
||||
io.grpc:grpc-okhttp:1.17.1
|
||||
io.grpc:grpc-protobuf-lite:1.17.1
|
||||
io.grpc:grpc-protobuf-nano:1.17.1
|
||||
io.grpc:grpc-protobuf:1.17.1
|
||||
io.grpc:grpc-stub:1.17.1
|
||||
io.grpc:grpc-testing:1.17.1
|
||||
io.netty:netty-buffer:4.1.30.Final
|
||||
io.netty:netty-codec-http2:4.1.30.Final
|
||||
io.netty:netty-codec-http:4.1.30.Final
|
||||
io.netty:netty-codec-socks:4.1.30.Final
|
||||
io.netty:netty-codec:4.1.30.Final
|
||||
io.netty:netty-common:4.1.30.Final
|
||||
io.netty:netty-handler-proxy:4.1.30.Final
|
||||
io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
javax.annotation:javax.annotation-api:1.3.2
|
||||
javax.annotation:jsr250-api:1.0
|
||||
javax.inject:javax.inject:1
|
||||
javax.jdo:jdo2-api:2.3-eb
|
||||
javax.mail:mail:1.4
|
||||
javax.persistence:javax.persistence-api:2.2
|
||||
javax.servlet:servlet-api:2.5
|
||||
javax.transaction:transaction-api:1.1
|
||||
javax.validation:validation-api:1.0.0.GA
|
||||
javax.xml.bind:jaxb-api:2.3.1
|
||||
jline:jline:1.0
|
||||
joda-time:joda-time:2.10.3
|
||||
junit:junit:4.12
|
||||
net.bytebuddy:byte-buddy:1.9.11
|
||||
net.java.dev.jna:jna-platform:5.3.1
|
||||
net.java.dev.jna:jna:5.3.1
|
||||
org.apache.avro:avro:1.8.2
|
||||
org.apache.beam:beam-model-job-management:2.16.0
|
||||
org.apache.beam:beam-model-pipeline:2.16.0
|
||||
org.apache.beam:beam-runners-core-construction-java:2.16.0
|
||||
org.apache.beam:beam-runners-google-cloud-dataflow-java:2.16.0
|
||||
org.apache.beam:beam-sdks-java-core:2.16.0
|
||||
org.apache.beam:beam-sdks-java-extensions-google-cloud-platform-core:2.16.0
|
||||
org.apache.beam:beam-sdks-java-extensions-protobuf:2.16.0
|
||||
org.apache.beam:beam-sdks-java-io-google-cloud-platform:2.16.0
|
||||
org.apache.beam:beam-vendor-bytebuddy-1_9_3:0.1
|
||||
org.apache.beam:beam-vendor-grpc-1_21_0:0.1
|
||||
org.apache.beam:beam-vendor-guava-26_0-jre:0.1
|
||||
org.apache.commons:commons-compress:1.19
|
||||
org.apache.commons:commons-lang3:3.5
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpg-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.jackson:jackson-core-asl:1.9.13
|
||||
org.codehaus.jackson:jackson-mapper-asl:1.9.13
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.dom4j:dom4j:2.1.1
|
||||
org.easymock:easymock:3.0
|
||||
org.glassfish.jaxb:jaxb-runtime:2.3.1
|
||||
org.glassfish.jaxb:txw2:2.3.1
|
||||
org.hamcrest:hamcrest-core:1.3
|
||||
org.hibernate.common:hibernate-commons-annotations:5.1.0.Final
|
||||
org.hibernate:hibernate-core:5.4.4.Final
|
||||
org.hibernate:hibernate-hikaricp:5.4.4.Final
|
||||
org.javassist:javassist:3.24.0-GA
|
||||
org.jboss.logging:jboss-logging:3.3.2.Final
|
||||
org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.1.1.Final
|
||||
org.jboss:jandex:2.0.5.Final
|
||||
org.jetbrains:annotations:17.0.0
|
||||
org.joda:joda-money:1.0.1
|
||||
org.json:json:20160810
|
||||
org.jvnet.staxex:stax-ex:1.8
|
||||
org.mortbay.jetty:jetty-util:6.1.26
|
||||
org.mortbay.jetty:jetty:6.1.26
|
||||
org.objenesis:objenesis:1.2
|
||||
org.ow2.asm:asm-analysis:7.0
|
||||
org.ow2.asm:asm-commons:6.0
|
||||
org.ow2.asm:asm-tree:7.0
|
||||
org.ow2.asm:asm-util:7.0
|
||||
org.ow2.asm:asm:7.0
|
||||
org.postgresql:postgresql:42.2.6
|
||||
org.rnorth.duct-tape:duct-tape:1.0.8
|
||||
org.rnorth.visible-assertions:visible-assertions:2.1.2
|
||||
org.rnorth:tcp-unix-socket-proxy:1.0.2
|
||||
org.scijava:native-lib-loader:2.0.2
|
||||
org.slf4j:slf4j-api:1.7.28
|
||||
org.testcontainers:database-commons:1.12.1
|
||||
org.testcontainers:jdbc:1.12.1
|
||||
org.testcontainers:postgresql:1.12.1
|
||||
org.testcontainers:testcontainers:1.12.1
|
||||
org.threeten:threetenbp:1.3.3
|
||||
org.tukaani:xz:1.8
|
||||
org.w3c.css:sac:1.3
|
||||
org.xerial.snappy:snappy-java:1.1.4
|
||||
org.yaml:snakeyaml:1.17
|
||||
xerces:xmlParserAPIs:2.6.2
|
||||
xpp3:xpp3:1.1.4c
|
||||
@@ -218,7 +218,6 @@ org.jetbrains:annotations:17.0.0
|
||||
org.joda:joda-money:1.0.1
|
||||
org.json:json:20160810
|
||||
org.jvnet.staxex:stax-ex:1.8
|
||||
org.mockito:mockito-core:1.9.5
|
||||
org.mortbay.jetty:jetty-util:6.1.26
|
||||
org.mortbay.jetty:jetty:6.1.26
|
||||
org.objenesis:objenesis:1.2
|
||||
|
||||
@@ -47,7 +47,7 @@ import org.joda.time.DateTime;
|
||||
path = "/_dr/cron/commitLogCheckpoint",
|
||||
method = Action.Method.GET,
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class CommitLogCheckpointAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -65,7 +65,7 @@ import org.joda.time.Duration;
|
||||
@Action(
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/task/deleteOldCommitLogs",
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class DeleteOldCommitLogsAction implements Runnable {
|
||||
|
||||
private static final int NUM_MAP_SHARDS = 20;
|
||||
|
||||
@@ -63,7 +63,7 @@ import org.joda.time.DateTime;
|
||||
path = ExportCommitLogDiffAction.PATH,
|
||||
method = Action.Method.POST,
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class ExportCommitLogDiffAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -111,7 +111,7 @@ import org.joda.time.Duration;
|
||||
@Action(
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/task/deleteContactsAndHosts",
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class DeleteContactsAndHostsAction implements Runnable {
|
||||
|
||||
static final String KIND_CONTACT = getKind(ContactResource.class);
|
||||
|
||||
@@ -55,7 +55,7 @@ import javax.inject.Inject;
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/task/deleteLoadTestData",
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class DeleteLoadTestDataAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -68,7 +68,7 @@ import org.joda.time.Duration;
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/task/deleteProberData",
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class DeleteProberDataAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -75,7 +75,7 @@ import org.joda.time.DateTime;
|
||||
@Action(
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/task/expandRecurringBillingEvents",
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class ExpandRecurringBillingEventsAction implements Runnable {
|
||||
|
||||
public static final String PARAM_CURSOR_TIME = "cursorTime";
|
||||
|
||||
@@ -75,7 +75,7 @@ import org.joda.time.Duration;
|
||||
@Action(
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/task/refreshDnsOnHostRename",
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class RefreshDnsOnHostRenameAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -33,7 +33,7 @@ import javax.inject.Inject;
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/cron/commitLogFanout",
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class CommitLogFanoutAction implements Runnable {
|
||||
|
||||
public static final String BUCKET_PARAM = "bucket";
|
||||
|
||||
@@ -87,7 +87,7 @@ import javax.inject.Inject;
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/cron/fanout",
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class TldFanoutAction implements Runnable {
|
||||
|
||||
/** A set of control params to TldFanoutAction that aren't passed down to the executing action. */
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.joda.time.Duration;
|
||||
path = PublishDnsUpdatesAction.PATH,
|
||||
method = POST,
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class PublishDnsUpdatesAction implements Runnable, Callable<Void> {
|
||||
|
||||
public static final String PATH = "/_dr/task/publishDnsUpdates";
|
||||
|
||||
@@ -80,7 +80,7 @@ import org.joda.time.Duration;
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/cron/readDnsQueue",
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class ReadDnsQueueAction implements Runnable {
|
||||
|
||||
private static final String PARAM_JITTER_SECONDS = "jitterSeconds";
|
||||
|
||||
@@ -35,7 +35,7 @@ import javax.inject.Inject;
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/dnsRefresh",
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class RefreshDnsAction implements Runnable {
|
||||
|
||||
private final Clock clock;
|
||||
|
||||
@@ -45,7 +45,7 @@ import javax.inject.Inject;
|
||||
path = BackupDatastoreAction.PATH,
|
||||
method = POST,
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class BackupDatastoreAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -51,7 +51,7 @@ import org.joda.time.Duration;
|
||||
path = BigqueryPollJobAction.PATH,
|
||||
method = {Action.Method.GET, Action.Method.POST},
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class BigqueryPollJobAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -59,7 +59,7 @@ import org.joda.time.format.PeriodFormat;
|
||||
path = CheckBackupAction.PATH,
|
||||
method = {POST, GET},
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class CheckBackupAction implements Runnable {
|
||||
|
||||
/** Parameter names for passing parameters into this action. */
|
||||
|
||||
@@ -65,7 +65,7 @@ import org.joda.time.DateTime;
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/task/exportDomainLists",
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class ExportDomainListsAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -49,7 +49,7 @@ import javax.inject.Inject;
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/task/exportPremiumTerms",
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class ExportPremiumTermsAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -37,7 +37,7 @@ import javax.inject.Inject;
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/task/exportReservedTerms",
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class ExportReservedTermsAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -56,7 +56,7 @@ import javax.inject.Inject;
|
||||
service = Action.Service.BACKEND,
|
||||
path = "/_dr/task/syncGroupMembers",
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class SyncGroupMembersAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -39,7 +39,7 @@ import javax.inject.Inject;
|
||||
service = Action.Service.BACKEND,
|
||||
path = UpdateSnapshotViewAction.PATH,
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class UpdateSnapshotViewAction implements Runnable {
|
||||
|
||||
/** Headers for passing parameters into the servlet. */
|
||||
|
||||
@@ -52,7 +52,7 @@ import javax.inject.Inject;
|
||||
service = Action.Service.BACKEND,
|
||||
path = UploadDatastoreBackupAction.PATH,
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class UploadDatastoreBackupAction implements Runnable {
|
||||
|
||||
/** Parameter names for passing parameters into the servlet. */
|
||||
|
||||
@@ -60,7 +60,7 @@ import org.joda.time.Duration;
|
||||
service = Action.Service.BACKEND,
|
||||
path = SyncRegistrarsSheetAction.PATH,
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class SyncRegistrarsSheetAction implements Runnable {
|
||||
|
||||
private enum Result {
|
||||
|
||||
@@ -109,7 +109,9 @@ public class FlowRunner {
|
||||
}
|
||||
}
|
||||
|
||||
/** Exception for explicitly propagating an EppException out of the transactional {@code Work}. */
|
||||
/**
|
||||
* Exception for explicitly propagating an EppException out of the transactional {@code Supplier}.
|
||||
*/
|
||||
private static class EppRuntimeException extends RuntimeException {
|
||||
EppRuntimeException(EppException cause) {
|
||||
super(cause);
|
||||
|
||||
@@ -30,28 +30,28 @@ import com.google.common.collect.ImmutableSet;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.BackupGroupRoot;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.transaction.TransactionManager.Work;
|
||||
import google.registry.util.Clock;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/** Wrapper for {@link Work} that associates a time with each attempt. */
|
||||
/** Wrapper for {@link Supplier} that associates a time with each attempt. */
|
||||
class CommitLoggedWork<R> implements Runnable {
|
||||
|
||||
private final Work<R> work;
|
||||
private final Supplier<R> work;
|
||||
private final Clock clock;
|
||||
|
||||
/**
|
||||
* Temporary place to store the result of a non-void work.
|
||||
*
|
||||
* <p>We don't want to return the result directly because we are going to try to recover from a
|
||||
* {@link com.google.appengine.api.datastore.DatastoreTimeoutException} deep inside Objectify
|
||||
* when it tries to commit the transaction. When an exception is thrown the return value would be
|
||||
* lost, but sometimes we will be able to determine that we actually succeeded despite the
|
||||
* timeout, and we'll want to get the result.
|
||||
* {@link com.google.appengine.api.datastore.DatastoreTimeoutException} deep inside Objectify when
|
||||
* it tries to commit the transaction. When an exception is thrown the return value would be lost,
|
||||
* but sometimes we will be able to determine that we actually succeeded despite the timeout, and
|
||||
* we'll want to get the result.
|
||||
*/
|
||||
private R result;
|
||||
|
||||
@@ -76,7 +76,7 @@ class CommitLoggedWork<R> implements Runnable {
|
||||
/** Lifecycle marker to track whether {@link #run} has been called. */
|
||||
private boolean runCalled;
|
||||
|
||||
CommitLoggedWork(Work<R> work, Clock clock) {
|
||||
CommitLoggedWork(Supplier<R> work, Clock clock) {
|
||||
this.work = work;
|
||||
this.clock = clock;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ class CommitLoggedWork<R> implements Runnable {
|
||||
// Set the time to be used for "now" within the transaction.
|
||||
try {
|
||||
Ofy.TRANSACTION_INFO.set(createNewTransactionInfo());
|
||||
result = work.run();
|
||||
result = work.get();
|
||||
saveCommitLog(Ofy.TRANSACTION_INFO.get());
|
||||
} finally {
|
||||
Ofy.TRANSACTION_INFO.set(previous);
|
||||
|
||||
@@ -17,6 +17,7 @@ package google.registry.model.ofy;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
|
||||
import google.registry.model.transaction.TransactionManager;
|
||||
import java.util.function.Supplier;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/** Datastore implementation of {@link TransactionManager}. */
|
||||
@@ -44,7 +45,7 @@ public class DatastoreTransactionManager implements TransactionManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T transact(Work<T> work) {
|
||||
public <T> T transact(Supplier<T> work) {
|
||||
return getOfy().transact(work);
|
||||
}
|
||||
|
||||
@@ -54,7 +55,7 @@ public class DatastoreTransactionManager implements TransactionManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T transactNew(Work<T> work) {
|
||||
public <T> T transactNew(Supplier<T> work) {
|
||||
return getOfy().transactNew(work);
|
||||
}
|
||||
|
||||
@@ -64,7 +65,7 @@ public class DatastoreTransactionManager implements TransactionManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R> R transactNewReadOnly(Work<R> work) {
|
||||
public <R> R transactNewReadOnly(Supplier<R> work) {
|
||||
return getOfy().transactNewReadOnly(work);
|
||||
}
|
||||
|
||||
@@ -74,7 +75,7 @@ public class DatastoreTransactionManager implements TransactionManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R> R doTransactionless(Work<R> work) {
|
||||
public <R> R doTransactionless(Supplier<R> work) {
|
||||
return getOfy().doTransactionless(work);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ import com.googlecode.objectify.cmd.Saver;
|
||||
import google.registry.model.annotations.NotBackedUp;
|
||||
import google.registry.model.annotations.VirtualEntity;
|
||||
import google.registry.model.ofy.ReadOnlyWork.KillTransactionException;
|
||||
import google.registry.model.transaction.TransactionManager.Work;
|
||||
import google.registry.util.Clock;
|
||||
import google.registry.util.NonFinalForTesting;
|
||||
import google.registry.util.Sleeper;
|
||||
@@ -46,6 +45,7 @@ import google.registry.util.SystemClock;
|
||||
import google.registry.util.SystemSleeper;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Supplier;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.Duration;
|
||||
@@ -194,9 +194,9 @@ public class Ofy {
|
||||
}
|
||||
|
||||
/** Execute a transaction. */
|
||||
<R> R transact(Work<R> work) {
|
||||
<R> R transact(Supplier<R> work) {
|
||||
// If we are already in a transaction, don't wrap in a CommitLoggedWork.
|
||||
return inTransaction() ? work.run() : transactNew(work);
|
||||
return inTransaction() ? work.get() : transactNew(work);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -214,7 +214,7 @@ public class Ofy {
|
||||
}
|
||||
|
||||
/** Pause the current transaction (if any) and complete this one before returning to it. */
|
||||
<R> R transactNew(Work<R> work) {
|
||||
<R> R transactNew(Supplier<R> work) {
|
||||
// Wrap the Work in a CommitLoggedWork so that we can give transactions a frozen view of time
|
||||
// and maintain commit logs for them.
|
||||
return transactCommitLoggedWork(new CommitLoggedWork<>(work, getClock()));
|
||||
@@ -298,7 +298,7 @@ public class Ofy {
|
||||
}
|
||||
|
||||
/** A read-only transaction is useful to get strongly consistent reads at a shared timestamp. */
|
||||
<R> R transactNewReadOnly(Work<R> work) {
|
||||
<R> R transactNewReadOnly(Supplier<R> work) {
|
||||
ReadOnlyWork<R> readOnlyWork = new ReadOnlyWork<>(work, getClock());
|
||||
try {
|
||||
ofy().transactNew(() -> {
|
||||
@@ -324,11 +324,11 @@ public class Ofy {
|
||||
}
|
||||
|
||||
/** Execute some work in a transactionless context. */
|
||||
<R> R doTransactionless(Work<R> work) {
|
||||
<R> R doTransactionless(Supplier<R> work) {
|
||||
try {
|
||||
com.googlecode.objectify.ObjectifyService.push(
|
||||
com.googlecode.objectify.ObjectifyService.ofy().transactionless());
|
||||
return work.run();
|
||||
return work.get();
|
||||
} finally {
|
||||
com.googlecode.objectify.ObjectifyService.pop();
|
||||
}
|
||||
@@ -342,11 +342,11 @@ public class Ofy {
|
||||
* Note that unlike a transaction's fresh session cache, the contents of this cache will be
|
||||
* discarded once the work completes, rather than being propagated into the enclosing session.
|
||||
*/
|
||||
public <R> R doWithFreshSessionCache(Work<R> work) {
|
||||
public <R> R doWithFreshSessionCache(Supplier<R> work) {
|
||||
try {
|
||||
com.googlecode.objectify.ObjectifyService.push(
|
||||
com.googlecode.objectify.ObjectifyService.factory().begin());
|
||||
return work.run();
|
||||
return work.get();
|
||||
} finally {
|
||||
com.googlecode.objectify.ObjectifyService.pop();
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
|
||||
package google.registry.model.ofy;
|
||||
|
||||
import google.registry.model.transaction.TransactionManager.Work;
|
||||
import google.registry.util.Clock;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/** Wrapper for {@link Work} that disallows mutations and fails the transaction at the end. */
|
||||
/** Wrapper for {@link Supplier} that disallows mutations and fails the transaction at the end. */
|
||||
class ReadOnlyWork<R> extends CommitLoggedWork<R> {
|
||||
|
||||
ReadOnlyWork(Work<R> work, Clock clock) {
|
||||
ReadOnlyWork(Supplier<R> work, Clock clock) {
|
||||
super(work, clock);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.google.common.base.Predicates.equalTo;
|
||||
import static com.google.common.base.Predicates.not;
|
||||
import static com.google.common.collect.ImmutableMap.toImmutableMap;
|
||||
import static com.google.common.collect.ImmutableSet.toImmutableSet;
|
||||
import static com.google.common.collect.Maps.toMap;
|
||||
import static google.registry.config.RegistryConfig.getSingletonCacheRefreshDuration;
|
||||
@@ -41,6 +40,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Ordering;
|
||||
import com.google.common.collect.Range;
|
||||
import com.google.common.net.InternetDomainName;
|
||||
@@ -265,11 +265,8 @@ public class Registry extends ImmutableObject implements Buildable {
|
||||
tld -> Key.create(getCrossTldKey(), Registry.class, tld));
|
||||
Map<Key<Registry>, Registry> entities =
|
||||
tm().doTransactionless(() -> ofy().load().keys(keysMap.values()));
|
||||
return keysMap.entrySet().stream()
|
||||
.collect(
|
||||
toImmutableMap(
|
||||
Map.Entry::getKey,
|
||||
e -> Optional.ofNullable(entities.getOrDefault(e.getValue(), null))));
|
||||
return Maps.transformEntries(
|
||||
keysMap, (k, v) -> Optional.ofNullable(entities.getOrDefault(v, null)));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ package google.registry.model.transaction;
|
||||
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.util.Clock;
|
||||
import java.util.function.Supplier;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
import javax.persistence.EntityTransaction;
|
||||
@@ -63,11 +64,11 @@ public class JpaTransactionManagerImpl implements JpaTransactionManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T transact(Work<T> work) {
|
||||
public <T> T transact(Supplier<T> work) {
|
||||
// TODO(shicong): Investigate removing transactNew functionality after migration as it may
|
||||
// be same as this one.
|
||||
if (inTransaction()) {
|
||||
return work.run();
|
||||
return work.get();
|
||||
}
|
||||
TransactionInfo txnInfo = transactionInfo.get();
|
||||
txnInfo.entityManager = emf.createEntityManager();
|
||||
@@ -76,7 +77,7 @@ public class JpaTransactionManagerImpl implements JpaTransactionManager {
|
||||
txn.begin();
|
||||
txnInfo.inTransaction = true;
|
||||
txnInfo.transactionTime = clock.nowUtc();
|
||||
T result = work.run();
|
||||
T result = work.get();
|
||||
txn.commit();
|
||||
return result;
|
||||
} catch (RuntimeException e) {
|
||||
@@ -102,7 +103,7 @@ public class JpaTransactionManagerImpl implements JpaTransactionManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T transactNew(Work<T> work) {
|
||||
public <T> T transactNew(Supplier<T> work) {
|
||||
// TODO(shicong): Implements the functionality to start a new transaction.
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -114,7 +115,7 @@ public class JpaTransactionManagerImpl implements JpaTransactionManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T transactNewReadOnly(Work<T> work) {
|
||||
public <T> T transactNewReadOnly(Supplier<T> work) {
|
||||
// TODO(shicong): Implements read only transaction.
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -126,7 +127,7 @@ public class JpaTransactionManagerImpl implements JpaTransactionManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T doTransactionless(Work<T> work) {
|
||||
public <T> T doTransactionless(Supplier<T> work) {
|
||||
// TODO(shicong): Implements doTransactionless.
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
package google.registry.model.transaction;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/**
|
||||
@@ -21,12 +22,6 @@ import org.joda.time.DateTime;
|
||||
*/
|
||||
public interface TransactionManager {
|
||||
|
||||
/** This functional interface defines a method to execute a work and return the result. */
|
||||
@FunctionalInterface
|
||||
interface Work<R> {
|
||||
R run();
|
||||
}
|
||||
|
||||
/** Returns {@code true} if the caller is in a transaction.
|
||||
*
|
||||
* <p>Note that this function is kept for backward compatibility. We will review the use case
|
||||
@@ -42,18 +37,19 @@ public interface TransactionManager {
|
||||
void assertInTransaction();
|
||||
|
||||
/** Executes the work in a transaction and returns the result. */
|
||||
<T> T transact(Work<T> work);
|
||||
<T> T transact(Supplier<T> work);
|
||||
|
||||
/** Executes the work in a transaction. */
|
||||
void transact(Runnable work);
|
||||
|
||||
/** Pauses the current transaction (if any), executes the work in a new transaction
|
||||
* and returns the result.
|
||||
/**
|
||||
* Pauses the current transaction (if any), executes the work in a new transaction and returns the
|
||||
* result.
|
||||
*
|
||||
* <p>Note that this function is kept for backward compatibility. We will review the use case
|
||||
* later when adding the cloud sql implementation.
|
||||
* <p>Note that this function is kept for backward compatibility. We will review the use case
|
||||
* later when adding the cloud sql implementation.
|
||||
*/
|
||||
<T> T transactNew(Work<T> work);
|
||||
<T> T transactNew(Supplier<T> work);
|
||||
|
||||
/** Pauses the current transaction (if any) and executes the work in a new transaction.
|
||||
*
|
||||
@@ -62,12 +58,13 @@ public interface TransactionManager {
|
||||
*/
|
||||
void transactNew(Runnable work);
|
||||
|
||||
/** Executes the work in a read-only transaction and returns the result.
|
||||
/**
|
||||
* Executes the work in a read-only transaction and returns the result.
|
||||
*
|
||||
* <p>Note that this function is kept for backward compatibility. We will review the use case
|
||||
* later when adding the cloud sql implementation.
|
||||
* <p>Note that this function is kept for backward compatibility. We will review the use case
|
||||
* later when adding the cloud sql implementation.
|
||||
*/
|
||||
<R> R transactNewReadOnly(Work<R> work);
|
||||
<R> R transactNewReadOnly(Supplier<R> work);
|
||||
|
||||
/** Executes the work in a read-only transaction.
|
||||
*
|
||||
@@ -77,7 +74,7 @@ public interface TransactionManager {
|
||||
void transactNewReadOnly(Runnable work);
|
||||
|
||||
/** Executes the work in a transactionless context. */
|
||||
<R> R doTransactionless(Work<R> work);
|
||||
<R> R doTransactionless(Supplier<R> work);
|
||||
|
||||
/** Returns the time associated with the start of this particular transaction attempt. */
|
||||
DateTime getTransactionTime();
|
||||
|
||||
@@ -58,7 +58,7 @@ import org.joda.time.DateTime;
|
||||
path = BrdaCopyAction.PATH,
|
||||
method = POST,
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class BrdaCopyAction implements Runnable {
|
||||
|
||||
static final String PATH = "/_dr/task/brdaCopy";
|
||||
|
||||
@@ -53,7 +53,7 @@ import org.joda.time.Duration;
|
||||
service = Action.Service.BACKEND,
|
||||
path = RdeReportAction.PATH,
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class RdeReportAction implements Runnable, EscrowTask {
|
||||
|
||||
static final String PATH = "/_dr/task/rdeReport";
|
||||
|
||||
@@ -195,7 +195,7 @@ import org.joda.time.Duration;
|
||||
service = Action.Service.BACKEND,
|
||||
path = RdeStagingAction.PATH,
|
||||
method = {GET, POST},
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class RdeStagingAction implements Runnable {
|
||||
|
||||
public static final String PATH = "/_dr/task/rdeStaging";
|
||||
|
||||
@@ -84,7 +84,7 @@ import org.joda.time.Duration;
|
||||
service = Action.Service.BACKEND,
|
||||
path = RdeUploadAction.PATH,
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class RdeUploadAction implements Runnable, EscrowTask {
|
||||
|
||||
static final String PATH = "/_dr/task/rdeUpload";
|
||||
|
||||
@@ -50,7 +50,7 @@ import org.joda.time.YearMonth;
|
||||
service = Action.Service.BACKEND,
|
||||
path = GenerateInvoicesAction.PATH,
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class GenerateInvoicesAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -68,7 +68,7 @@ import org.joda.time.format.DateTimeFormat;
|
||||
service = Action.Service.BACKEND,
|
||||
path = IcannReportingStagingAction.PATH,
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class IcannReportingStagingAction implements Runnable {
|
||||
|
||||
static final String PATH = "/_dr/task/icannReportingStaging";
|
||||
|
||||
@@ -49,7 +49,7 @@ import org.joda.time.LocalDate;
|
||||
service = Action.Service.BACKEND,
|
||||
path = GenerateSpec11ReportAction.PATH,
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class GenerateSpec11ReportAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -73,15 +73,7 @@ public enum Auth {
|
||||
AUTH_INTERNAL_OR_ADMIN(
|
||||
ImmutableList.of(AuthMethod.INTERNAL, AuthMethod.API),
|
||||
AuthLevel.APP,
|
||||
UserPolicy.ADMIN),
|
||||
|
||||
/**
|
||||
* Allows only internal (App Engine task-queue) access.
|
||||
*/
|
||||
AUTH_INTERNAL_ONLY(
|
||||
ImmutableList.of(AuthMethod.INTERNAL),
|
||||
AuthLevel.APP,
|
||||
UserPolicy.IGNORED);
|
||||
UserPolicy.ADMIN);
|
||||
|
||||
private final AuthSettings authSettings;
|
||||
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
// Copyright 2019 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.schema.tld;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.model.CreateAutoTimestamp;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.registry.label.ReservationType;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.persistence.CollectionTable;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.ElementCollection;
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Index;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.MapKeyColumn;
|
||||
import javax.persistence.Table;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/**
|
||||
* A list of reserved domain labels that are blocked from being registered for various reasons.
|
||||
*
|
||||
* <p>Note that the primary key of this entity is {@link #revisionId}, which is auto-generated by
|
||||
* the database. So, if a retry of insertion happens after the previous attempt unexpectedly
|
||||
* succeeds, we will end up with having two exact same reserved lists that differ only by
|
||||
* revisionId. This is fine though, because we only use the list with the highest revisionId.
|
||||
*/
|
||||
@Entity
|
||||
@Table(indexes = {@Index(columnList = "name", name = "reservedlist_name_idx")})
|
||||
public class ReservedList extends ImmutableObject {
|
||||
|
||||
@Column(nullable = false)
|
||||
private String name;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(nullable = false)
|
||||
private Long revisionId;
|
||||
|
||||
@Column(nullable = false)
|
||||
private CreateAutoTimestamp creationTimestamp = CreateAutoTimestamp.create(null);
|
||||
|
||||
@Column(nullable = false)
|
||||
private Boolean shouldPublish;
|
||||
|
||||
@ElementCollection
|
||||
@CollectionTable(
|
||||
name = "ReservedEntry",
|
||||
joinColumns = @JoinColumn(name = "revisionId", referencedColumnName = "revisionId"))
|
||||
@MapKeyColumn(name = "domainLabel")
|
||||
private Map<String, ReservedEntry> labelsToReservations;
|
||||
|
||||
@Embeddable
|
||||
public static class ReservedEntry extends ImmutableObject {
|
||||
@Column(nullable = false)
|
||||
private ReservationType reservationType;
|
||||
|
||||
@Column(nullable = true)
|
||||
private String comment;
|
||||
|
||||
private ReservedEntry(ReservationType reservationType, @Nullable String comment) {
|
||||
this.reservationType = reservationType;
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
// Hibernate requires this default constructor.
|
||||
private ReservedEntry() {}
|
||||
|
||||
/** Constructs a {@link ReservedEntry} object. */
|
||||
public static ReservedEntry create(ReservationType reservationType, @Nullable String comment) {
|
||||
return new ReservedEntry(reservationType, comment);
|
||||
}
|
||||
|
||||
/** Returns the reservation type for this entry. */
|
||||
public ReservationType getReservationType() {
|
||||
return reservationType;
|
||||
}
|
||||
|
||||
/** Returns the comment for this entry. Retruns null if there is no comment. */
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
}
|
||||
|
||||
private ReservedList(
|
||||
String name, Boolean shouldPublish, Map<String, ReservedEntry> labelsToReservations) {
|
||||
this.name = name;
|
||||
this.shouldPublish = shouldPublish;
|
||||
this.labelsToReservations = labelsToReservations;
|
||||
}
|
||||
|
||||
// Hibernate requires this default constructor.
|
||||
private ReservedList() {}
|
||||
|
||||
/** Constructs a {@link ReservedList} object. */
|
||||
public static ReservedList create(
|
||||
String name, Boolean shouldPublish, Map<String, ReservedEntry> labelsToReservations) {
|
||||
return new ReservedList(name, shouldPublish, labelsToReservations);
|
||||
}
|
||||
|
||||
/** Returns the name of the reserved list. */
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/** Returns the ID of this revision, or throws if null. */
|
||||
public Long getRevisionId() {
|
||||
checkState(
|
||||
revisionId != null,
|
||||
"revisionId is null because this object has not been persisted to the database yet");
|
||||
return revisionId;
|
||||
}
|
||||
|
||||
/** Returns the creation time of this revision of the reserved list. */
|
||||
public DateTime getCreationTimestamp() {
|
||||
return creationTimestamp.getTimestamp();
|
||||
}
|
||||
|
||||
/** Returns a {@link Map} of domain labels to {@link ReservedEntry}. */
|
||||
public ImmutableMap<String, ReservedEntry> getLabelsToReservations() {
|
||||
return ImmutableMap.copyOf(labelsToReservations);
|
||||
}
|
||||
|
||||
/** Returns true if the reserved list should be published. */
|
||||
public Boolean getShouldPublish() {
|
||||
return shouldPublish;
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ import org.joda.time.Duration;
|
||||
path = NordnUploadAction.PATH,
|
||||
method = Action.Method.POST,
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class NordnUploadAction implements Runnable {
|
||||
|
||||
static final String PATH = "/_dr/task/nordnUpload";
|
||||
|
||||
@@ -56,7 +56,7 @@ import javax.inject.Inject;
|
||||
path = NordnVerifyAction.PATH,
|
||||
method = Action.Method.POST,
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class NordnVerifyAction implements Runnable {
|
||||
|
||||
static final String PATH = "/_dr/task/nordnVerify";
|
||||
|
||||
@@ -32,7 +32,7 @@ import javax.inject.Inject;
|
||||
path = "/_dr/task/tmchCrl",
|
||||
method = POST,
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class TmchCrlAction implements Runnable {
|
||||
|
||||
@Inject Marksdb marksdb;
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.bouncycastle.openpgp.PGPException;
|
||||
path = "/_dr/task/tmchDnl",
|
||||
method = POST,
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class TmchDnlAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.bouncycastle.openpgp.PGPException;
|
||||
path = "/_dr/task/tmchSmdrl",
|
||||
method = POST,
|
||||
automaticallyPrintOk = true,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public final class TmchSmdrlAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@@ -104,6 +104,8 @@ final class RegistryCli implements AutoCloseable, CommandRunner {
|
||||
// Create all command instances. It would be preferrable to do this in the constructor, but
|
||||
// JCommander mutates the command instances and doesn't reset them so we have to do it for every
|
||||
// run.
|
||||
// TODO(weiminyu): extract this into a standalone static method to simplify
|
||||
// :core:registryToolIntegrationTest
|
||||
try {
|
||||
for (Map.Entry<String, ? extends Class<? extends Command>> entry : commands.entrySet()) {
|
||||
Command command = entry.getValue().getDeclaredConstructor().newInstance();
|
||||
|
||||
@@ -48,7 +48,7 @@ import javax.inject.Inject;
|
||||
service = Action.Service.TOOLS,
|
||||
path = "/_dr/task/killAllCommitLogs",
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class KillAllCommitLogsAction implements Runnable {
|
||||
|
||||
@Inject MapreduceRunner mrRunner;
|
||||
|
||||
@@ -44,7 +44,7 @@ import javax.inject.Inject;
|
||||
service = Action.Service.TOOLS,
|
||||
path = "/_dr/task/killAllEppResources",
|
||||
method = POST,
|
||||
auth = Auth.AUTH_INTERNAL_ONLY)
|
||||
auth = Auth.AUTH_INTERNAL_OR_ADMIN)
|
||||
public class KillAllEppResourcesAction implements Runnable {
|
||||
|
||||
@Inject MapreduceRunner mrRunner;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<class>google.registry.schema.tmch.ClaimsList</class>
|
||||
<class>google.registry.model.transfer.BaseTransferObject</class>
|
||||
<class>google.registry.schema.tld.PremiumList</class>
|
||||
<class>google.registry.schema.tld.ReservedList</class>
|
||||
<class>google.registry.model.domain.secdns.DelegationSignerData</class>
|
||||
<class>google.registry.model.domain.DesignatedContact</class>
|
||||
<class>google.registry.model.domain.DomainBase</class>
|
||||
|
||||
@@ -45,12 +45,12 @@ import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.transaction.TransactionManager.Work;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.DatastoreHelper;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.util.SystemClock;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.function.Supplier;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@@ -239,72 +239,88 @@ public class OfyTest {
|
||||
|
||||
@Test
|
||||
public void testTransact_transientFailureException_retries() {
|
||||
assertThat(tm().transact(new Work<Integer>() {
|
||||
assertThat(
|
||||
tm().transact(
|
||||
new Supplier<Integer>() {
|
||||
|
||||
int count = 0;
|
||||
int count = 0;
|
||||
|
||||
@Override
|
||||
public Integer run() {
|
||||
count++;
|
||||
if (count == 3) {
|
||||
return count;
|
||||
}
|
||||
throw new TransientFailureException("");
|
||||
}})).isEqualTo(3);
|
||||
@Override
|
||||
public Integer get() {
|
||||
count++;
|
||||
if (count == 3) {
|
||||
return count;
|
||||
}
|
||||
throw new TransientFailureException("");
|
||||
}
|
||||
}))
|
||||
.isEqualTo(3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTransact_datastoreTimeoutException_noManifest_retries() {
|
||||
assertThat(tm().transact(new Work<Integer>() {
|
||||
assertThat(
|
||||
tm().transact(
|
||||
new Supplier<Integer>() {
|
||||
|
||||
int count = 0;
|
||||
int count = 0;
|
||||
|
||||
@Override
|
||||
public Integer run() {
|
||||
// We don't write anything in this transaction, so there is no commit log manifest.
|
||||
// Therefore it's always safe to retry since nothing got written.
|
||||
count++;
|
||||
if (count == 3) {
|
||||
return count;
|
||||
}
|
||||
throw new DatastoreTimeoutException("");
|
||||
}})).isEqualTo(3);
|
||||
@Override
|
||||
public Integer get() {
|
||||
// We don't write anything in this transaction, so there is no commit log
|
||||
// manifest.
|
||||
// Therefore it's always safe to retry since nothing got written.
|
||||
count++;
|
||||
if (count == 3) {
|
||||
return count;
|
||||
}
|
||||
throw new DatastoreTimeoutException("");
|
||||
}
|
||||
}))
|
||||
.isEqualTo(3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTransact_datastoreTimeoutException_manifestNotWrittenToDatastore_retries() {
|
||||
assertThat(tm().transact(new Work<Integer>() {
|
||||
assertThat(
|
||||
tm().transact(
|
||||
new Supplier<Integer>() {
|
||||
|
||||
int count = 0;
|
||||
int count = 0;
|
||||
|
||||
@Override
|
||||
public Integer run() {
|
||||
// There will be something in the manifest now, but it won't be committed if we throw.
|
||||
ofy().save().entity(someObject);
|
||||
count++;
|
||||
if (count == 3) {
|
||||
return count;
|
||||
}
|
||||
throw new DatastoreTimeoutException("");
|
||||
}})).isEqualTo(3);
|
||||
@Override
|
||||
public Integer get() {
|
||||
// There will be something in the manifest now, but it won't be committed if
|
||||
// we throw.
|
||||
ofy().save().entity(someObject);
|
||||
count++;
|
||||
if (count == 3) {
|
||||
return count;
|
||||
}
|
||||
throw new DatastoreTimeoutException("");
|
||||
}
|
||||
}))
|
||||
.isEqualTo(3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTransact_datastoreTimeoutException_manifestWrittenToDatastore_returnsSuccess() {
|
||||
// A work unit that throws if it is ever retried.
|
||||
Work work = new Work<Void>() {
|
||||
boolean firstCallToVrun = true;
|
||||
Supplier work =
|
||||
new Supplier<Void>() {
|
||||
boolean firstCallToVrun = true;
|
||||
|
||||
@Override
|
||||
public Void run() {
|
||||
if (firstCallToVrun) {
|
||||
firstCallToVrun = false;
|
||||
ofy().save().entity(someObject);
|
||||
return null;
|
||||
}
|
||||
fail("Shouldn't have retried.");
|
||||
return null;
|
||||
}};
|
||||
@Override
|
||||
public Void get() {
|
||||
if (firstCallToVrun) {
|
||||
firstCallToVrun = false;
|
||||
ofy().save().entity(someObject);
|
||||
return null;
|
||||
}
|
||||
fail("Shouldn't have retried.");
|
||||
return null;
|
||||
}
|
||||
};
|
||||
// A commit logged work that throws on the first attempt to get its result.
|
||||
CommitLoggedWork<Void> commitLoggedWork = new CommitLoggedWork<Void>(work, new SystemClock()) {
|
||||
boolean firstCallToGetResult = true;
|
||||
@@ -323,18 +339,22 @@ public class OfyTest {
|
||||
}
|
||||
|
||||
void doReadOnlyRetryTest(final RuntimeException e) {
|
||||
assertThat(tm().transactNewReadOnly(new Work<Integer>() {
|
||||
assertThat(
|
||||
tm().transactNewReadOnly(
|
||||
new Supplier<Integer>() {
|
||||
|
||||
int count = 0;
|
||||
int count = 0;
|
||||
|
||||
@Override
|
||||
public Integer run() {
|
||||
count++;
|
||||
if (count == 3) {
|
||||
return count;
|
||||
}
|
||||
throw e;
|
||||
}})).isEqualTo(3);
|
||||
@Override
|
||||
public Integer get() {
|
||||
count++;
|
||||
if (count == 3) {
|
||||
return count;
|
||||
}
|
||||
throw new TransientFailureException("");
|
||||
}
|
||||
}))
|
||||
.isEqualTo(3);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -16,7 +16,7 @@ package google.registry.request;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.request.auth.Auth.AUTH_INTERNAL_ONLY;
|
||||
import static google.registry.request.auth.Auth.AUTH_INTERNAL_OR_ADMIN;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import java.util.Optional;
|
||||
@@ -45,7 +45,7 @@ public final class RouterTest {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Action(service = Action.Service.DEFAULT, path = "/sloth", auth = AUTH_INTERNAL_ONLY)
|
||||
@Action(service = Action.Service.DEFAULT, path = "/sloth", auth = AUTH_INTERNAL_OR_ADMIN)
|
||||
public static final class SlothTask implements Runnable {
|
||||
@Override
|
||||
public void run() {}
|
||||
@@ -79,7 +79,7 @@ public final class RouterTest {
|
||||
service = Action.Service.DEFAULT,
|
||||
path = "/prefix",
|
||||
isPrefix = true,
|
||||
auth = AUTH_INTERNAL_ONLY)
|
||||
auth = AUTH_INTERNAL_OR_ADMIN)
|
||||
public static final class PrefixTask implements Runnable {
|
||||
@Override
|
||||
public void run() {}
|
||||
@@ -109,7 +109,7 @@ public final class RouterTest {
|
||||
service = Action.Service.DEFAULT,
|
||||
path = "/prefix/long",
|
||||
isPrefix = true,
|
||||
auth = AUTH_INTERNAL_ONLY)
|
||||
auth = AUTH_INTERNAL_OR_ADMIN)
|
||||
public static final class LongTask implements Runnable {
|
||||
@Override
|
||||
public void run() {}
|
||||
@@ -164,7 +164,7 @@ public final class RouterTest {
|
||||
@Action(
|
||||
service = Action.Service.DEFAULT,
|
||||
path = "/samePathAsOtherTask",
|
||||
auth = AUTH_INTERNAL_ONLY)
|
||||
auth = AUTH_INTERNAL_OR_ADMIN)
|
||||
public static final class DuplicateTask1 implements Runnable {
|
||||
@Override
|
||||
public void run() {}
|
||||
@@ -173,7 +173,7 @@ public final class RouterTest {
|
||||
@Action(
|
||||
service = Action.Service.DEFAULT,
|
||||
path = "/samePathAsOtherTask",
|
||||
auth = AUTH_INTERNAL_ONLY)
|
||||
auth = AUTH_INTERNAL_OR_ADMIN)
|
||||
public static final class DuplicateTask2 implements Runnable {
|
||||
@Override
|
||||
public void run() {}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class RequestAuthenticatorTest {
|
||||
AuthLevel.NONE,
|
||||
UserPolicy.IGNORED);
|
||||
|
||||
private static final AuthSettings AUTH_INTERNAL_ONLY = AuthSettings.create(
|
||||
private static final AuthSettings AUTH_INTERNAL_OR_ADMIN = AuthSettings.create(
|
||||
ImmutableList.of(AuthMethod.INTERNAL),
|
||||
AuthLevel.APP,
|
||||
UserPolicy.IGNORED);
|
||||
@@ -157,7 +157,7 @@ public class RequestAuthenticatorTest {
|
||||
|
||||
@Test
|
||||
public void testInternalAuth_notInvokedInternally() {
|
||||
Optional<AuthResult> authResult = runTest(mockUserService, AUTH_INTERNAL_ONLY);
|
||||
Optional<AuthResult> authResult = runTest(mockUserService, AUTH_INTERNAL_OR_ADMIN);
|
||||
|
||||
verifyZeroInteractions(mockUserService);
|
||||
assertThat(authResult).isEmpty();
|
||||
@@ -167,7 +167,7 @@ public class RequestAuthenticatorTest {
|
||||
public void testInternalAuth_success() {
|
||||
when(req.getHeader("X-AppEngine-QueueName")).thenReturn("__cron");
|
||||
|
||||
Optional<AuthResult> authResult = runTest(mockUserService, AUTH_INTERNAL_ONLY);
|
||||
Optional<AuthResult> authResult = runTest(mockUserService, AUTH_INTERNAL_OR_ADMIN);
|
||||
|
||||
verifyZeroInteractions(mockUserService);
|
||||
assertThat(authResult).isPresent();
|
||||
|
||||
+8
-3
@@ -71,8 +71,13 @@ public class SqlIntegrationMembershipTest {
|
||||
}
|
||||
|
||||
private static boolean isSqlDependent(Class<?> testClass) {
|
||||
return Stream.of(testClass.getDeclaredFields())
|
||||
.map(Field::getType)
|
||||
.anyMatch(JpaTransactionManagerRule.class::equals);
|
||||
for (Class<?> clazz = testClass; clazz != null; clazz = clazz.getSuperclass()) {
|
||||
if (Stream.of(clazz.getDeclaredFields())
|
||||
.map(Field::getType)
|
||||
.anyMatch(JpaTransactionManagerRule.class::equals)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
// Copyright 2019 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.schema.tld;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.model.registry.label.ReservationType;
|
||||
import google.registry.schema.tld.ReservedList.ReservedEntry;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
/** Unit tests for {@link ReservedList} */
|
||||
@RunWith(JUnit4.class)
|
||||
public class ReservedListTest {
|
||||
|
||||
@Test
|
||||
public void verifyConstructorAndGetters_workCorrectly() {
|
||||
ReservedList reservedList =
|
||||
ReservedList.create(
|
||||
"app",
|
||||
false,
|
||||
ImmutableMap.of(
|
||||
"book",
|
||||
ReservedEntry.create(ReservationType.ALLOWED_IN_SUNRISE, null),
|
||||
"music",
|
||||
ReservedEntry.create(
|
||||
ReservationType.RESERVED_FOR_ANCHOR_TENANT, "reserved for anchor tenant")));
|
||||
|
||||
assertThat(reservedList.getName()).isEqualTo("app");
|
||||
assertThat(reservedList.getShouldPublish()).isFalse();
|
||||
assertThat(reservedList.getLabelsToReservations())
|
||||
.containsExactly(
|
||||
"book",
|
||||
ReservedEntry.create(ReservationType.ALLOWED_IN_SUNRISE, null),
|
||||
"music",
|
||||
ReservedEntry.create(
|
||||
ReservationType.RESERVED_FOR_ANCHOR_TENANT, "reserved for anchor tenant"));
|
||||
}
|
||||
}
|
||||
@@ -37,18 +37,18 @@ public class GoldenFileTestHelper {
|
||||
String goldenFileDescription = null;
|
||||
|
||||
private static final String UPDATE_COMMAND =
|
||||
"nomulus -e localhost %1$s > %2$s";
|
||||
"../gradlew nomulus && java -jar build/libs/nomulus.jar -e localhost %s > %s";
|
||||
|
||||
private static final String UPDATE_INSTRUCTIONS =
|
||||
Joiner.on('\n')
|
||||
.join(
|
||||
"",
|
||||
"-------------------------------------------------------------------------------",
|
||||
"Your changes affect the %3$s. To update the checked-in version, run:",
|
||||
"Your changes affect the %s. To update the checked-in version, run the following"
|
||||
+ " command in the core project:",
|
||||
UPDATE_COMMAND,
|
||||
"");
|
||||
|
||||
|
||||
public static GoldenFileTestHelper assertThat(String actualValue) {
|
||||
return new GoldenFileTestHelper().setActualValue(actualValue);
|
||||
}
|
||||
@@ -82,9 +82,9 @@ public class GoldenFileTestHelper {
|
||||
actualValue, expectedValue);
|
||||
assertWithMessage(
|
||||
UPDATE_INSTRUCTIONS,
|
||||
goldenFileDescription,
|
||||
nomulusCommand,
|
||||
filePath(context, filename),
|
||||
goldenFileDescription)
|
||||
filePath(context, filename))
|
||||
.fail();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
PATH CLASS METHODS OK AUTH_METHODS MIN USER_POLICY
|
||||
/_dr/cron/commitLogCheckpoint CommitLogCheckpointAction GET y INTERNAL APP IGNORED
|
||||
/_dr/cron/commitLogFanout CommitLogFanoutAction GET y INTERNAL APP IGNORED
|
||||
/_dr/cron/fanout TldFanoutAction GET y INTERNAL APP IGNORED
|
||||
/_dr/cron/readDnsQueue ReadDnsQueueAction GET y INTERNAL APP IGNORED
|
||||
/_dr/dnsRefresh RefreshDnsAction GET y INTERNAL APP IGNORED
|
||||
/_dr/task/backupDatastore BackupDatastoreAction POST y INTERNAL APP IGNORED
|
||||
/_dr/task/brdaCopy BrdaCopyAction POST y INTERNAL APP IGNORED
|
||||
/_dr/task/checkDatastoreBackup CheckBackupAction POST,GET y INTERNAL APP IGNORED
|
||||
/_dr/cron/commitLogCheckpoint CommitLogCheckpointAction GET y INTERNAL,API APP ADMIN
|
||||
/_dr/cron/commitLogFanout CommitLogFanoutAction GET y INTERNAL,API APP ADMIN
|
||||
/_dr/cron/fanout TldFanoutAction GET y INTERNAL,API APP ADMIN
|
||||
/_dr/cron/readDnsQueue ReadDnsQueueAction GET y INTERNAL,API APP ADMIN
|
||||
/_dr/dnsRefresh RefreshDnsAction GET y INTERNAL,API APP ADMIN
|
||||
/_dr/task/backupDatastore BackupDatastoreAction POST y INTERNAL,API APP ADMIN
|
||||
/_dr/task/brdaCopy BrdaCopyAction POST y INTERNAL,API APP ADMIN
|
||||
/_dr/task/checkDatastoreBackup CheckBackupAction POST,GET y INTERNAL,API APP ADMIN
|
||||
/_dr/task/copyDetailReports CopyDetailReportsAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/deleteContactsAndHosts DeleteContactsAndHostsAction GET n INTERNAL APP IGNORED
|
||||
/_dr/task/deleteLoadTestData DeleteLoadTestDataAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/deleteOldCommitLogs DeleteOldCommitLogsAction GET n INTERNAL APP IGNORED
|
||||
/_dr/task/deleteProberData DeleteProberDataAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/expandRecurringBillingEvents ExpandRecurringBillingEventsAction GET n INTERNAL APP IGNORED
|
||||
/_dr/task/exportCommitLogDiff ExportCommitLogDiffAction POST y INTERNAL APP IGNORED
|
||||
/_dr/task/exportDomainLists ExportDomainListsAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/exportPremiumTerms ExportPremiumTermsAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/exportReservedTerms ExportReservedTermsAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/generateInvoices GenerateInvoicesAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/generateSpec11 GenerateSpec11ReportAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/icannReportingStaging IcannReportingStagingAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/deleteContactsAndHosts DeleteContactsAndHostsAction GET n INTERNAL,API APP ADMIN
|
||||
/_dr/task/deleteLoadTestData DeleteLoadTestDataAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/deleteOldCommitLogs DeleteOldCommitLogsAction GET n INTERNAL,API APP ADMIN
|
||||
/_dr/task/deleteProberData DeleteProberDataAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/expandRecurringBillingEvents ExpandRecurringBillingEventsAction GET n INTERNAL,API APP ADMIN
|
||||
/_dr/task/exportCommitLogDiff ExportCommitLogDiffAction POST y INTERNAL,API APP ADMIN
|
||||
/_dr/task/exportDomainLists ExportDomainListsAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/exportPremiumTerms ExportPremiumTermsAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/exportReservedTerms ExportReservedTermsAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/generateInvoices GenerateInvoicesAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/generateSpec11 GenerateSpec11ReportAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/icannReportingStaging IcannReportingStagingAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/icannReportingUpload IcannReportingUploadAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/nordnUpload NordnUploadAction POST y INTERNAL APP IGNORED
|
||||
/_dr/task/nordnVerify NordnVerifyAction POST y INTERNAL APP IGNORED
|
||||
/_dr/task/pollBigqueryJob BigqueryPollJobAction GET,POST y INTERNAL APP IGNORED
|
||||
/_dr/task/publishDnsUpdates PublishDnsUpdatesAction POST y INTERNAL APP IGNORED
|
||||
/_dr/task/nordnUpload NordnUploadAction POST y INTERNAL,API APP ADMIN
|
||||
/_dr/task/nordnVerify NordnVerifyAction POST y INTERNAL,API APP ADMIN
|
||||
/_dr/task/pollBigqueryJob BigqueryPollJobAction GET,POST y INTERNAL,API APP ADMIN
|
||||
/_dr/task/publishDnsUpdates PublishDnsUpdatesAction POST y INTERNAL,API APP ADMIN
|
||||
/_dr/task/publishInvoices PublishInvoicesAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/publishSpec11 PublishSpec11ReportAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/rdeReport RdeReportAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/rdeStaging RdeStagingAction GET,POST n INTERNAL APP IGNORED
|
||||
/_dr/task/rdeUpload RdeUploadAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/refreshDnsOnHostRename RefreshDnsOnHostRenameAction GET n INTERNAL APP IGNORED
|
||||
/_dr/task/rdeReport RdeReportAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/rdeStaging RdeStagingAction GET,POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/rdeUpload RdeUploadAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/refreshDnsOnHostRename RefreshDnsOnHostRenameAction GET n INTERNAL,API APP ADMIN
|
||||
/_dr/task/resaveAllEppResources ResaveAllEppResourcesAction GET n INTERNAL,API APP ADMIN
|
||||
/_dr/task/resaveEntity ResaveEntityAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/syncGroupMembers SyncGroupMembersAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/syncRegistrarsSheet SyncRegistrarsSheetAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/tmchCrl TmchCrlAction POST y INTERNAL APP IGNORED
|
||||
/_dr/task/tmchDnl TmchDnlAction POST y INTERNAL APP IGNORED
|
||||
/_dr/task/tmchSmdrl TmchSmdrlAction POST y INTERNAL APP IGNORED
|
||||
/_dr/task/syncGroupMembers SyncGroupMembersAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/syncRegistrarsSheet SyncRegistrarsSheetAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/tmchCrl TmchCrlAction POST y INTERNAL,API APP ADMIN
|
||||
/_dr/task/tmchDnl TmchDnlAction POST y INTERNAL,API APP ADMIN
|
||||
/_dr/task/tmchSmdrl TmchSmdrlAction POST y INTERNAL,API APP ADMIN
|
||||
/_dr/task/updateRegistrarRdapBaseUrls UpdateRegistrarRdapBaseUrlsAction GET y INTERNAL,API APP ADMIN
|
||||
/_dr/task/updateSnapshotView UpdateSnapshotViewAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/uploadDatastoreBackup UploadDatastoreBackupAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/updateSnapshotView UpdateSnapshotViewAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/uploadDatastoreBackup UploadDatastoreBackupAction POST n INTERNAL,API APP ADMIN
|
||||
|
||||
@@ -13,8 +13,8 @@ PATH CLASS METHODS OK AUTH
|
||||
/_dr/epptool EppToolAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/loadtest LoadTestAction POST y INTERNAL,API APP ADMIN
|
||||
/_dr/task/generateZoneFiles GenerateZoneFilesAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/killAllCommitLogs KillAllCommitLogsAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/killAllEppResources KillAllEppResourcesAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/killAllCommitLogs KillAllCommitLogsAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/killAllEppResources KillAllEppResourcesAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/refreshDnsForAllDomains RefreshDnsForAllDomainsAction GET n INTERNAL,API APP ADMIN
|
||||
/_dr/task/resaveAllHistoryEntries ResaveAllHistoryEntriesAction GET n INTERNAL,API APP ADMIN
|
||||
/_dr/task/restoreCommitLogs RestoreCommitLogsAction POST y INTERNAL,API APP ADMIN
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.fasterxml.jackson.core:jackson-core:2.1.3
|
||||
com.github.jnr:jffi:1.2.17
|
||||
com.github.jnr:jnr-a64asm:1.0.0
|
||||
com.github.jnr:jnr-constants:0.9.11
|
||||
com.github.jnr:jnr-enxio:0.19
|
||||
com.github.jnr:jnr-ffi:2.1.9
|
||||
com.github.jnr:jnr-posix:3.0.47
|
||||
com.github.jnr:jnr-unixsocket:0.21
|
||||
com.github.jnr:jnr-x86asm:1.0.2
|
||||
com.google.api-client:google-api-client:1.23.0
|
||||
com.google.apis:google-api-services-sqladmin:v1beta4-rev56-1.23.0
|
||||
com.google.cloud.sql:jdbc-socket-factory-core:1.0.12
|
||||
com.google.cloud.sql:postgres-socket-factory:1.0.12
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.errorprone:error_prone_annotations:2.1.3
|
||||
com.google.guava:guava:26.0-android
|
||||
com.google.http-client:google-http-client-jackson2:1.23.0
|
||||
com.google.http-client:google-http-client:1.23.0
|
||||
com.google.j2objc:j2objc-annotations:1.1
|
||||
com.google.oauth-client:google-oauth-client:1.23.0
|
||||
commons-codec:commons-codec:1.3
|
||||
commons-logging:commons-logging:1.1.1
|
||||
org.apache.httpcomponents:httpclient:4.0.1
|
||||
org.apache.httpcomponents:httpcore:4.0.1
|
||||
org.checkerframework:checker-compat-qual:2.5.2
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.14
|
||||
org.flywaydb:flyway-core:5.2.4
|
||||
org.ow2.asm:asm-analysis:7.0
|
||||
org.ow2.asm:asm-commons:5.0.3
|
||||
org.ow2.asm:asm-tree:7.0
|
||||
org.ow2.asm:asm-util:7.0
|
||||
org.ow2.asm:asm:7.0
|
||||
org.postgresql:postgresql:42.2.6
|
||||
@@ -0,0 +1,36 @@
|
||||
-- Copyright 2019 The Nomulus Authors. All Rights Reserved.
|
||||
--
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
-- You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing, software
|
||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
create table "ReservedEntry" (
|
||||
revision_id int8 not null,
|
||||
comment text,
|
||||
reservation_type int4 not null,
|
||||
domain_label text not null,
|
||||
primary key (revision_id, domain_label)
|
||||
);
|
||||
|
||||
create table "ReservedList" (
|
||||
revision_id bigserial not null,
|
||||
creation_timestamp timestamptz not null,
|
||||
name text not null,
|
||||
should_publish boolean not null,
|
||||
primary key (revision_id)
|
||||
);
|
||||
|
||||
create index reservedlist_name_idx on "ReservedList" (name);
|
||||
|
||||
alter table if exists "ReservedEntry"
|
||||
add constraint FKgq03rk0bt1hb915dnyvd3vnfc
|
||||
foreign key (revision_id)
|
||||
references "ReservedList";
|
||||
@@ -152,6 +152,22 @@
|
||||
primary key (revision_id)
|
||||
);
|
||||
|
||||
create table "ReservedEntry" (
|
||||
revision_id int8 not null,
|
||||
comment text,
|
||||
reservation_type int4 not null,
|
||||
domain_label text not null,
|
||||
primary key (revision_id, domain_label)
|
||||
);
|
||||
|
||||
create table "ReservedList" (
|
||||
revision_id bigserial not null,
|
||||
creation_timestamp timestamptz not null,
|
||||
name text not null,
|
||||
should_publish boolean not null,
|
||||
primary key (revision_id)
|
||||
);
|
||||
|
||||
alter table if exists "Domain_DelegationSignerData"
|
||||
add constraint UK_2yp55erx1i51pa7gnb8bu7tjn unique (ds_data_key_tag);
|
||||
|
||||
@@ -166,6 +182,7 @@ create index idx_registry_lock_registrar_id on "RegistryLock" (registrar_id);
|
||||
|
||||
alter table if exists "RegistryLock"
|
||||
add constraint idx_registry_lock_repo_id_revision_id unique (repo_id, revision_id);
|
||||
create index reservedlist_name_idx on "ReservedList" (name);
|
||||
|
||||
alter table if exists "ClaimsEntry"
|
||||
add constraint FK6sc6at5hedffc0nhdcab6ivuq
|
||||
@@ -221,3 +238,8 @@ create index idx_registry_lock_registrar_id on "RegistryLock" (registrar_id);
|
||||
add constraint FKo0gw90lpo1tuee56l0nb6y6g5
|
||||
foreign key (revision_id)
|
||||
references "PremiumList";
|
||||
|
||||
alter table if exists "ReservedEntry"
|
||||
add constraint FKgq03rk0bt1hb915dnyvd3vnfc
|
||||
foreign key (revision_id)
|
||||
references "ReservedList";
|
||||
|
||||
@@ -141,6 +141,49 @@ CREATE SEQUENCE public."RegistryLock_revision_id_seq"
|
||||
ALTER SEQUENCE public."RegistryLock_revision_id_seq" OWNED BY public."RegistryLock".revision_id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: ReservedEntry; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public."ReservedEntry" (
|
||||
revision_id bigint NOT NULL,
|
||||
comment text,
|
||||
reservation_type integer NOT NULL,
|
||||
domain_label text NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ReservedList; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public."ReservedList" (
|
||||
revision_id bigint NOT NULL,
|
||||
creation_timestamp timestamp with time zone NOT NULL,
|
||||
name text NOT NULL,
|
||||
should_publish boolean NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ReservedList_revision_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public."ReservedList_revision_id_seq"
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: ReservedList_revision_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE public."ReservedList_revision_id_seq" OWNED BY public."ReservedList".revision_id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: ClaimsList revision_id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
@@ -162,6 +205,13 @@ ALTER TABLE ONLY public."PremiumList" ALTER COLUMN revision_id SET DEFAULT nextv
|
||||
ALTER TABLE ONLY public."RegistryLock" ALTER COLUMN revision_id SET DEFAULT nextval('public."RegistryLock_revision_id_seq"'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ReservedList revision_id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."ReservedList" ALTER COLUMN revision_id SET DEFAULT nextval('public."ReservedList_revision_id_seq"'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ClaimsEntry ClaimsEntry_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
@@ -202,6 +252,22 @@ ALTER TABLE ONLY public."RegistryLock"
|
||||
ADD CONSTRAINT "RegistryLock_pkey" PRIMARY KEY (revision_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ReservedEntry ReservedEntry_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."ReservedEntry"
|
||||
ADD CONSTRAINT "ReservedEntry_pkey" PRIMARY KEY (revision_id, domain_label);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ReservedList ReservedList_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."ReservedList"
|
||||
ADD CONSTRAINT "ReservedList_pkey" PRIMARY KEY (revision_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: RegistryLock idx_registry_lock_repo_id_revision_id; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
@@ -231,6 +297,13 @@ CREATE INDEX idx_registry_lock_verification_code ON public."RegistryLock" USING
|
||||
CREATE INDEX premiumlist_name_idx ON public."PremiumList" USING btree (name);
|
||||
|
||||
|
||||
--
|
||||
-- Name: reservedlist_name_idx; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX reservedlist_name_idx ON public."ReservedList" USING btree (name);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ClaimsEntry fk6sc6at5hedffc0nhdcab6ivuq; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
@@ -239,6 +312,14 @@ ALTER TABLE ONLY public."ClaimsEntry"
|
||||
ADD CONSTRAINT fk6sc6at5hedffc0nhdcab6ivuq FOREIGN KEY (revision_id) REFERENCES public."ClaimsList"(revision_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ReservedEntry fkgq03rk0bt1hb915dnyvd3vnfc; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."ReservedEntry"
|
||||
ADD CONSTRAINT fkgq03rk0bt1hb915dnyvd3vnfc FOREIGN KEY (revision_id) REFERENCES public."ReservedList"(revision_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: PremiumEntry fko0gw90lpo1tuee56l0nb6y6g5; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
@@ -117,11 +117,6 @@ make sense. A master enumeration lists all the valid triplets. They are:
|
||||
because we don't require a user for internal requests, but the user policy
|
||||
is `ADMIN`, meaning that if there *is* a user, it needs to be an admin.
|
||||
|
||||
* `AUTH_INTERNAL_ONLY`: Only internal requests are allowed. This is appropriate
|
||||
for actions which are only executed by cron jobs, and therefore have no
|
||||
authenticated user. The method is `INTERNAL`, the minimum level is `APP`,
|
||||
and the user policy is `IGNORED`.
|
||||
|
||||
* `AUTH_PUBLIC_OR_INTERNAL`: Allows anyone access, as long as they use OAuth to
|
||||
authenticate. Also allows access from App Engine task-queue. Note that OAuth
|
||||
client ID still needs to be whitelisted in the config file for OAuth-based
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -41,6 +41,16 @@ where:
|
||||
|
||||
SCRIPT_DIR="$(realpath $(dirname $0))"
|
||||
|
||||
function showNoncompliantFiles() {
|
||||
local forkPoint="$1"
|
||||
local message="$2"
|
||||
|
||||
git diff -U0 ${forkPoint} | \
|
||||
${SCRIPT_DIR}/google-java-format-diff.py -p1 | \
|
||||
awk -v "message=$message" \
|
||||
'/\+\+\+ ([^ ]*)/ { print message $2 }' 1>&2
|
||||
}
|
||||
|
||||
function callGoogleJavaFormatDiff() {
|
||||
local forkPoint
|
||||
forkPoint=$(git merge-base --fork-point origin/master)
|
||||
@@ -48,10 +58,12 @@ function callGoogleJavaFormatDiff() {
|
||||
local callResult
|
||||
case "$1" in
|
||||
"check")
|
||||
showNoncompliantFiles "$forkPoint" "\033[1mNeeds formatting: "
|
||||
callResult=$(git diff -U0 ${forkPoint} | \
|
||||
${SCRIPT_DIR}/google-java-format-diff.py -p1 | wc -l)
|
||||
;;
|
||||
"format")
|
||||
showNoncompliantFiles "$forkPoint" "\033[1mReformatting: "
|
||||
callResult=$(git diff -U0 ${forkPoint} | \
|
||||
${SCRIPT_DIR}/google-java-format-diff.py -p1 -i)
|
||||
;;
|
||||
@@ -60,6 +72,7 @@ function callGoogleJavaFormatDiff() {
|
||||
${SCRIPT_DIR}/google-java-format-diff.py -p1)
|
||||
;;
|
||||
esac
|
||||
echo -e "\033[0m" 1>&2
|
||||
echo "${callResult}"
|
||||
exit 0
|
||||
}
|
||||
|
||||
@@ -28,6 +28,46 @@ tasks.test.dependsOn tasks.checkstyleTest
|
||||
// TODO(weiminyu): investigate incremental coverage change calculation and alert.
|
||||
tasks.test.finalizedBy jacocoTestReport
|
||||
|
||||
// Exclude test-only dependencies from release artifacts.
|
||||
// TLDR: Project dependency should be on runtimeClasspath. A custom
|
||||
// configuration 'deploy_jar' is used as a proxy to expose runtimeClasspath
|
||||
// to other projects. It is also convenient to exclude test-only jars from
|
||||
// runtimeClasspath.
|
||||
//
|
||||
// Here is the context:
|
||||
// - Some dependencies have test-only jars on their 'compile' classpaths.
|
||||
// - As a result, they appear in our 'compile', 'runtimeClasspath' and
|
||||
// 'default' configurations, among others, and end up in our release war
|
||||
// files.
|
||||
// - Since these jars are needed for our own tests, we can only exclude them
|
||||
// from runtimeClasspath. Excluding them from 'compile' or 'runtime' would
|
||||
// also exclude them from testCompileClasspath and testRuntimeClasspath,
|
||||
// resulting in test failures.
|
||||
// - If configuration is not specified, project dependency uses the 'default'
|
||||
// configuration, which always has the same content as 'runtime'.
|
||||
// - When release is involved, 'runtimeClasspath' is actually the right
|
||||
// configuration to use. The 'runtime' configuration does not include
|
||||
// 'runtimeOnly' dependencies, while 'runtimeClasspath' does.
|
||||
// - 'runtimeClasspath' cannot be referenced directly by another project.
|
||||
// We use a custom configuration 'deploy_jar' as a proxy.
|
||||
// TODO(weiminyu): Fix all project dependencies to use deploy_jar
|
||||
configurations {
|
||||
deploy_jar.extendsFrom runtimeClasspath
|
||||
|
||||
all.findAll {
|
||||
it.name in ['runtimeClasspath', 'compileClasspath']
|
||||
}.each {
|
||||
// JUnit is from org.apache.beam:beam-runners-google-cloud-dataflow-java,
|
||||
// testcontainer (which we use in the nomulus tool), and json-simple.
|
||||
// We should really be excluding this, however GenerateSqlCommand in
|
||||
// nomulus-tool currently uses testcontainers which, in turn, needs junit.
|
||||
//exclude group: 'junit'
|
||||
// Mockito is from org.apache.beam:beam-runners-google-cloud-dataflow-java
|
||||
// See https://issues.apache.org/jira/browse/BEAM-8862
|
||||
it.exclude group: 'org.mockito', module: 'mockito-core'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// compatibility with Java 8
|
||||
errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
|
||||
|
||||
@@ -24,6 +24,7 @@ dependencies {
|
||||
compile deps['io.netty:netty-handler']
|
||||
compile deps['io.netty:netty-transport']
|
||||
compile deps['javax.inject:javax.inject']
|
||||
compile project(':util')
|
||||
|
||||
runtime deps['com.google.flogger:flogger-system-backend']
|
||||
runtime deps['io.netty:netty-tcnative-boringssl-static']
|
||||
|
||||
@@ -1,13 +1,30 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.flogger:flogger:0.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.re2j:re2j:1.1
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.netty:netty-buffer:4.1.31.Final
|
||||
io.netty:netty-codec-http:4.1.31.Final
|
||||
io.netty:netty-codec:4.1.31.Final
|
||||
@@ -15,6 +32,15 @@ io.netty:netty-common:4.1.31.Final
|
||||
io.netty:netty-handler:4.1.31.Final
|
||||
io.netty:netty-resolver:4.1.31.Final
|
||||
io.netty:netty-transport:4.1.31.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.activation:activation:1.1
|
||||
javax.inject:javax.inject:1
|
||||
javax.mail:mail:1.4
|
||||
javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
@@ -1,13 +1,30 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.flogger:flogger:0.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.re2j:re2j:1.1
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.netty:netty-buffer:4.1.31.Final
|
||||
io.netty:netty-codec-http:4.1.31.Final
|
||||
io.netty:netty-codec:4.1.31.Final
|
||||
@@ -15,6 +32,15 @@ io.netty:netty-common:4.1.31.Final
|
||||
io.netty:netty-handler:4.1.31.Final
|
||||
io.netty:netty-resolver:4.1.31.Final
|
||||
io.netty:netty-transport:4.1.31.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.activation:activation:1.1
|
||||
javax.inject:javax.inject:1
|
||||
javax.mail:mail:1.4
|
||||
javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
@@ -1,14 +1,31 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.flogger:flogger-system-backend:0.1
|
||||
com.google.flogger:flogger:0.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.re2j:re2j:1.1
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.netty:netty-buffer:4.1.31.Final
|
||||
io.netty:netty-codec-http:4.1.31.Final
|
||||
io.netty:netty-codec:4.1.31.Final
|
||||
@@ -17,6 +34,15 @@ io.netty:netty-handler:4.1.31.Final
|
||||
io.netty:netty-resolver:4.1.31.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.22.Final
|
||||
io.netty:netty-transport:4.1.31.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.activation:activation:1.1
|
||||
javax.inject:javax.inject:1
|
||||
javax.mail:mail:1.4
|
||||
javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.flogger:flogger-system-backend:0.1
|
||||
com.google.flogger:flogger:0.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.re2j:re2j:1.1
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.netty:netty-buffer:4.1.31.Final
|
||||
io.netty:netty-codec-http:4.1.31.Final
|
||||
io.netty:netty-codec:4.1.31.Final
|
||||
io.netty:netty-common:4.1.31.Final
|
||||
io.netty:netty-handler:4.1.31.Final
|
||||
io.netty:netty-resolver:4.1.31.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.22.Final
|
||||
io.netty:netty-transport:4.1.31.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.activation:activation:1.1
|
||||
javax.inject:javax.inject:1
|
||||
javax.mail:mail:1.4
|
||||
javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
@@ -1,14 +1,31 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.flogger:flogger-system-backend:0.1
|
||||
com.google.flogger:flogger:0.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.re2j:re2j:1.1
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.netty:netty-buffer:4.1.31.Final
|
||||
io.netty:netty-codec-http:4.1.31.Final
|
||||
io.netty:netty-codec:4.1.31.Final
|
||||
@@ -17,6 +34,15 @@ io.netty:netty-handler:4.1.31.Final
|
||||
io.netty:netty-resolver:4.1.31.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.22.Final
|
||||
io.netty:netty-transport:4.1.31.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.activation:activation:1.1
|
||||
javax.inject:javax.inject:1
|
||||
javax.mail:mail:1.4
|
||||
javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
@@ -1,14 +1,31 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.flogger:flogger-system-backend:0.1
|
||||
com.google.flogger:flogger:0.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.re2j:re2j:1.1
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.netty:netty-buffer:4.1.31.Final
|
||||
io.netty:netty-codec-http:4.1.31.Final
|
||||
io.netty:netty-codec:4.1.31.Final
|
||||
@@ -17,6 +34,15 @@ io.netty:netty-handler:4.1.31.Final
|
||||
io.netty:netty-resolver:4.1.31.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.22.Final
|
||||
io.netty:netty-transport:4.1.31.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.activation:activation:1.1
|
||||
javax.inject:javax.inject:1
|
||||
javax.mail:mail:1.4
|
||||
javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
@@ -1,16 +1,32 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.flogger:flogger:0.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.re2j:re2j:1.1
|
||||
com.google.truth:truth:1.0
|
||||
com.googlecode.java-diff-utils:diffutils:1.3.0
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.netty:netty-buffer:4.1.31.Final
|
||||
io.netty:netty-codec-http:4.1.31.Final
|
||||
io.netty:netty-codec:4.1.31.Final
|
||||
@@ -18,11 +34,20 @@ io.netty:netty-common:4.1.31.Final
|
||||
io.netty:netty-handler:4.1.31.Final
|
||||
io.netty:netty-resolver:4.1.31.Final
|
||||
io.netty:netty-transport:4.1.31.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.activation:activation:1.1
|
||||
javax.inject:javax.inject:1
|
||||
javax.mail:mail:1.4
|
||||
javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
junit:junit:4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpkix-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-compat-qual:2.5.5
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.hamcrest:hamcrest-core:1.3
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
@@ -1,16 +1,32 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.flogger:flogger:0.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.re2j:re2j:1.1
|
||||
com.google.truth:truth:1.0
|
||||
com.googlecode.java-diff-utils:diffutils:1.3.0
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.netty:netty-buffer:4.1.31.Final
|
||||
io.netty:netty-codec-http:4.1.31.Final
|
||||
io.netty:netty-codec:4.1.31.Final
|
||||
@@ -18,11 +34,20 @@ io.netty:netty-common:4.1.31.Final
|
||||
io.netty:netty-handler:4.1.31.Final
|
||||
io.netty:netty-resolver:4.1.31.Final
|
||||
io.netty:netty-transport:4.1.31.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.activation:activation:1.1
|
||||
javax.inject:javax.inject:1
|
||||
javax.mail:mail:1.4
|
||||
javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
junit:junit:4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpkix-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-compat-qual:2.5.5
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.hamcrest:hamcrest-core:1.3
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
@@ -1,17 +1,33 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.flogger:flogger-system-backend:0.1
|
||||
com.google.flogger:flogger:0.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.re2j:re2j:1.1
|
||||
com.google.truth:truth:1.0
|
||||
com.googlecode.java-diff-utils:diffutils:1.3.0
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.netty:netty-buffer:4.1.31.Final
|
||||
io.netty:netty-codec-http:4.1.31.Final
|
||||
io.netty:netty-codec:4.1.31.Final
|
||||
@@ -20,11 +36,20 @@ io.netty:netty-handler:4.1.31.Final
|
||||
io.netty:netty-resolver:4.1.31.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.22.Final
|
||||
io.netty:netty-transport:4.1.31.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.activation:activation:1.1
|
||||
javax.inject:javax.inject:1
|
||||
javax.mail:mail:1.4
|
||||
javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
junit:junit:4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpkix-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-compat-qual:2.5.5
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.hamcrest:hamcrest-core:1.3
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
@@ -1,17 +1,33 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.flogger:flogger-system-backend:0.1
|
||||
com.google.flogger:flogger:0.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.re2j:re2j:1.1
|
||||
com.google.truth:truth:1.0
|
||||
com.googlecode.java-diff-utils:diffutils:1.3.0
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.netty:netty-buffer:4.1.31.Final
|
||||
io.netty:netty-codec-http:4.1.31.Final
|
||||
io.netty:netty-codec:4.1.31.Final
|
||||
@@ -20,11 +36,20 @@ io.netty:netty-handler:4.1.31.Final
|
||||
io.netty:netty-resolver:4.1.31.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.22.Final
|
||||
io.netty:netty-transport:4.1.31.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.activation:activation:1.1
|
||||
javax.inject:javax.inject:1
|
||||
javax.mail:mail:1.4
|
||||
javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
junit:junit:4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpkix-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-compat-qual:2.5.5
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.hamcrest:hamcrest-core:1.3
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
+30
-4
@@ -14,9 +14,13 @@
|
||||
|
||||
package google.registry.networking.handler;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static google.registry.util.X509Utils.getCertificateHash;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelHandler.Sharable;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
import io.netty.channel.embedded.EmbeddedChannel;
|
||||
@@ -29,6 +33,8 @@ import io.netty.util.AttributeKey;
|
||||
import io.netty.util.concurrent.Future;
|
||||
import io.netty.util.concurrent.Promise;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.cert.CertificateExpiredException;
|
||||
import java.security.cert.CertificateNotYetValidException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -58,6 +64,8 @@ public class SslServerInitializer<C extends Channel> extends ChannelInitializer<
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
private final boolean requireClientCert;
|
||||
// TODO(jianglai): Always validate client certs (if required).
|
||||
private final boolean validateClientCert;
|
||||
private final SslProvider sslProvider;
|
||||
// We use suppliers for the key/cert pair because they are fetched and cached from GCS, and can
|
||||
// change when the artifacts on GCS changes.
|
||||
@@ -66,11 +74,16 @@ public class SslServerInitializer<C extends Channel> extends ChannelInitializer<
|
||||
|
||||
public SslServerInitializer(
|
||||
boolean requireClientCert,
|
||||
boolean validateClientCert,
|
||||
SslProvider sslProvider,
|
||||
Supplier<PrivateKey> privateKeySupplier,
|
||||
Supplier<ImmutableList<X509Certificate>> certificatesSupplier) {
|
||||
logger.atInfo().log("Server SSL Provider: %s", sslProvider);
|
||||
checkArgument(
|
||||
requireClientCert || !validateClientCert,
|
||||
"Cannot validate client certificate if client certificate is not required.");
|
||||
this.requireClientCert = requireClientCert;
|
||||
this.validateClientCert = validateClientCert;
|
||||
this.sslProvider = sslProvider;
|
||||
this.privateKeySupplier = privateKeySupplier;
|
||||
this.certificatesSupplier = certificatesSupplier;
|
||||
@@ -95,10 +108,23 @@ public class SslServerInitializer<C extends Channel> extends ChannelInitializer<
|
||||
.addListener(
|
||||
future -> {
|
||||
if (future.isSuccess()) {
|
||||
Promise<X509Certificate> unusedPromise =
|
||||
clientCertificatePromise.setSuccess(
|
||||
(X509Certificate)
|
||||
sslHandler.engine().getSession().getPeerCertificates()[0]);
|
||||
X509Certificate clientCertificate =
|
||||
(X509Certificate)
|
||||
sslHandler.engine().getSession().getPeerCertificates()[0];
|
||||
try {
|
||||
clientCertificate.checkValidity();
|
||||
Promise<X509Certificate> unusedPromise =
|
||||
clientCertificatePromise.setSuccess(clientCertificate);
|
||||
} catch (CertificateNotYetValidException | CertificateExpiredException e) {
|
||||
logger.atWarning().withCause(e).log(
|
||||
"Client certificate is not valid.\nHash: %s",
|
||||
getCertificateHash(clientCertificate));
|
||||
if (validateClientCert) {
|
||||
Promise<X509Certificate> unusedPromise =
|
||||
clientCertificatePromise.setFailure(e);
|
||||
ChannelFuture unusedFuture2 = channel.close();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Promise<X509Certificate> unusedPromise =
|
||||
clientCertificatePromise.setFailure(future.cause());
|
||||
|
||||
@@ -61,7 +61,9 @@ public final class NettyRule extends ExternalResource {
|
||||
// Handler attached to client's channel to record the response received.
|
||||
private DumpHandler dumpHandler;
|
||||
|
||||
private Channel channel;
|
||||
private Channel clientChannel;
|
||||
|
||||
private Channel serverChannel;
|
||||
|
||||
public EventLoopGroup getEventLoopGroup() {
|
||||
return eventLoopGroup;
|
||||
@@ -79,6 +81,7 @@ public final class NettyRule extends ExternalResource {
|
||||
ch.pipeline().addLast(handlers);
|
||||
// Add the "echoHandler" last to log the incoming message and send it back
|
||||
ch.pipeline().addLast(echoHandler);
|
||||
serverChannel = ch;
|
||||
}
|
||||
};
|
||||
ServerBootstrap sb =
|
||||
@@ -109,11 +112,11 @@ public final class NettyRule extends ExternalResource {
|
||||
.group(eventLoopGroup)
|
||||
.channel(LocalChannel.class)
|
||||
.handler(clientInitializer);
|
||||
channel = b.connect(localAddress).syncUninterruptibly().channel();
|
||||
clientChannel = b.connect(localAddress).syncUninterruptibly().channel();
|
||||
}
|
||||
|
||||
void checkReady() {
|
||||
checkState(channel != null, "Must call setUpClient to finish NettyRule setup");
|
||||
checkState(clientChannel != null, "Must call setUpClient to finish NettyRule setup");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,16 +128,21 @@ public final class NettyRule extends ExternalResource {
|
||||
*/
|
||||
void assertThatMessagesWork() throws Exception {
|
||||
checkReady();
|
||||
assertThat(channel.isActive()).isTrue();
|
||||
assertThat(clientChannel.isActive()).isTrue();
|
||||
|
||||
writeToChannelAndFlush(channel, "Hello, world!");
|
||||
writeToChannelAndFlush(clientChannel, "Hello, world!");
|
||||
assertThat(echoHandler.getRequestFuture().get()).isEqualTo("Hello, world!");
|
||||
assertThat(dumpHandler.getResponseFuture().get()).isEqualTo("Hello, world!");
|
||||
}
|
||||
|
||||
Channel getChannel() {
|
||||
Channel getClientChannel() {
|
||||
checkReady();
|
||||
return channel;
|
||||
return clientChannel;
|
||||
}
|
||||
|
||||
Channel getServerChannel() {
|
||||
checkReady();
|
||||
return serverChannel;
|
||||
}
|
||||
|
||||
ThrowableSubject assertThatServerRootCause() {
|
||||
|
||||
+78
-4
@@ -18,6 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.networking.handler.SslInitializerTestUtils.getKeyPair;
|
||||
import static google.registry.networking.handler.SslInitializerTestUtils.setUpSslChannel;
|
||||
import static google.registry.networking.handler.SslInitializerTestUtils.signKeyPair;
|
||||
import static google.registry.networking.handler.SslInitializerTestUtils.verifySslExcpetion;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import io.netty.channel.Channel;
|
||||
@@ -39,7 +40,12 @@ import java.security.KeyPair;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.cert.CertPathBuilderException;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.CertificateExpiredException;
|
||||
import java.security.cert.CertificateNotYetValidException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Date;
|
||||
import java.util.function.Function;
|
||||
import javax.net.ssl.SSLException;
|
||||
import javax.net.ssl.SSLSession;
|
||||
@@ -159,7 +165,7 @@ public class SslClientInitializerTest {
|
||||
// exceptions.
|
||||
nettyRule.assertThatClientRootCause().isInstanceOf(CertPathBuilderException.class);
|
||||
nettyRule.assertThatServerRootCause().isInstanceOf(SSLException.class);
|
||||
assertThat(nettyRule.getChannel().isActive()).isFalse();
|
||||
assertThat(nettyRule.getClientChannel().isActive()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -184,13 +190,81 @@ public class SslClientInitializerTest {
|
||||
sslProvider, hostProvider, portProvider, ImmutableList.of(ssc.cert()), null, null);
|
||||
nettyRule.setUpClient(localAddress, sslClientInitializer);
|
||||
|
||||
setUpSslChannel(nettyRule.getChannel(), cert);
|
||||
setUpSslChannel(nettyRule.getClientChannel(), cert);
|
||||
nettyRule.assertThatMessagesWork();
|
||||
|
||||
// Verify that the SNI extension is sent during handshake.
|
||||
assertThat(sniHostReceived).isEqualTo(SSL_HOST);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_customTrustManager_serverCertExpired() throws Exception {
|
||||
LocalAddress localAddress =
|
||||
new LocalAddress("CUSTOM_TRUST_MANAGER_SERVE_CERT_EXPIRED_" + sslProvider);
|
||||
|
||||
// Generate a new key pair.
|
||||
KeyPair keyPair = getKeyPair();
|
||||
|
||||
// Generate a self signed certificate, and use it to sign the key pair.
|
||||
SelfSignedCertificate ssc = new SelfSignedCertificate();
|
||||
X509Certificate cert =
|
||||
signKeyPair(
|
||||
ssc,
|
||||
keyPair,
|
||||
SSL_HOST,
|
||||
Date.from(Instant.now().minus(Duration.ofDays(2))),
|
||||
Date.from(Instant.now().minus(Duration.ofDays(1))));
|
||||
|
||||
// Set up the server to use the signed cert and private key to perform handshake;
|
||||
PrivateKey privateKey = keyPair.getPrivate();
|
||||
nettyRule.setUpServer(localAddress, getServerHandler(false, privateKey, cert));
|
||||
|
||||
// Set up the client to trust the self signed cert used to sign the cert that server provides.
|
||||
SslClientInitializer<LocalChannel> sslClientInitializer =
|
||||
new SslClientInitializer<>(
|
||||
sslProvider, hostProvider, portProvider, ImmutableList.of(ssc.cert()), null, null);
|
||||
nettyRule.setUpClient(localAddress, sslClientInitializer);
|
||||
|
||||
verifySslExcpetion(
|
||||
nettyRule.getClientChannel(),
|
||||
channel -> channel.pipeline().get(SslHandler.class).handshakeFuture().get(),
|
||||
CertificateExpiredException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_customTrustManager_serverCertNotYetValid() throws Exception {
|
||||
LocalAddress localAddress =
|
||||
new LocalAddress("CUSTOM_TRUST_MANAGER_SERVE_CERT_NOT_YET_VALID_" + sslProvider);
|
||||
|
||||
// Generate a new key pair.
|
||||
KeyPair keyPair = getKeyPair();
|
||||
|
||||
// Generate a self signed certificate, and use it to sign the key pair.
|
||||
SelfSignedCertificate ssc = new SelfSignedCertificate();
|
||||
X509Certificate cert =
|
||||
signKeyPair(
|
||||
ssc,
|
||||
keyPair,
|
||||
SSL_HOST,
|
||||
Date.from(Instant.now().plus(Duration.ofDays(1))),
|
||||
Date.from(Instant.now().plus(Duration.ofDays(2))));
|
||||
|
||||
// Set up the server to use the signed cert and private key to perform handshake;
|
||||
PrivateKey privateKey = keyPair.getPrivate();
|
||||
nettyRule.setUpServer(localAddress, getServerHandler(false, privateKey, cert));
|
||||
|
||||
// Set up the client to trust the self signed cert used to sign the cert that server provides.
|
||||
SslClientInitializer<LocalChannel> sslClientInitializer =
|
||||
new SslClientInitializer<>(
|
||||
sslProvider, hostProvider, portProvider, ImmutableList.of(ssc.cert()), null, null);
|
||||
nettyRule.setUpClient(localAddress, sslClientInitializer);
|
||||
|
||||
verifySslExcpetion(
|
||||
nettyRule.getClientChannel(),
|
||||
channel -> channel.pipeline().get(SslHandler.class).handshakeFuture().get(),
|
||||
CertificateNotYetValidException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_customTrustManager_acceptSelfSignedCert_clientCertRequired()
|
||||
throws Exception {
|
||||
@@ -215,7 +289,7 @@ public class SslClientInitializerTest {
|
||||
() -> ImmutableList.of(clientSsc.cert()));
|
||||
nettyRule.setUpClient(localAddress, sslClientInitializer);
|
||||
|
||||
SSLSession sslSession = setUpSslChannel(nettyRule.getChannel(), serverSsc.cert());
|
||||
SSLSession sslSession = setUpSslChannel(nettyRule.getClientChannel(), serverSsc.cert());
|
||||
nettyRule.assertThatMessagesWork();
|
||||
|
||||
// Verify that the SNI extension is sent during handshake.
|
||||
@@ -255,6 +329,6 @@ public class SslClientInitializerTest {
|
||||
nettyRule.assertThatClientRootCause().isInstanceOf(CertificateException.class);
|
||||
nettyRule.assertThatClientRootCause().hasMessageThat().contains(SSL_HOST);
|
||||
nettyRule.assertThatServerRootCause().isInstanceOf(SSLException.class);
|
||||
assertThat(nettyRule.getChannel().isActive()).isFalse();
|
||||
assertThat(nettyRule.getClientChannel().isActive()).isFalse();
|
||||
}
|
||||
}
|
||||
|
||||
+45
-4
@@ -15,8 +15,11 @@
|
||||
package google.registry.networking.handler;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.handler.ssl.SslHandler;
|
||||
import io.netty.handler.ssl.util.SelfSignedCertificate;
|
||||
import java.math.BigInteger;
|
||||
@@ -28,6 +31,7 @@ import java.security.cert.X509Certificate;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import org.bouncycastle.asn1.x500.X500Name;
|
||||
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
|
||||
@@ -61,17 +65,17 @@ public final class SslInitializerTestUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Signs the given key pair with the given self signed certificate.
|
||||
* Signs the given key pair with the given self signed certificate to generate a certificate with
|
||||
* the given validity range.
|
||||
*
|
||||
* @return signed public key (of the key pair) certificate
|
||||
*/
|
||||
public static X509Certificate signKeyPair(
|
||||
SelfSignedCertificate ssc, KeyPair keyPair, String hostname) throws Exception {
|
||||
SelfSignedCertificate ssc, KeyPair keyPair, String hostname, Date from, Date to)
|
||||
throws Exception {
|
||||
X500Name subjectDnName = new X500Name("CN=" + hostname);
|
||||
BigInteger serialNumber = BigInteger.valueOf(System.currentTimeMillis());
|
||||
X500Name issuerDnName = new X500Name(ssc.cert().getIssuerDN().getName());
|
||||
Date from = Date.from(Instant.now().minus(Duration.ofDays(1)));
|
||||
Date to = Date.from(Instant.now().plus(Duration.ofDays(1)));
|
||||
SubjectPublicKeyInfo subPubKeyInfo =
|
||||
SubjectPublicKeyInfo.getInstance(keyPair.getPublic().getEncoded());
|
||||
AlgorithmIdentifier sigAlgId =
|
||||
@@ -89,6 +93,22 @@ public final class SslInitializerTestUtils {
|
||||
return new JcaX509CertificateConverter().setProvider("BC").getCertificate(certificateHolder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Signs the given key pair with the given self signed certificate to generate a certificate that
|
||||
* is valid from yesterday to tomorrow.
|
||||
*
|
||||
* @return signed public key (of the key pair) certificate
|
||||
*/
|
||||
public static X509Certificate signKeyPair(
|
||||
SelfSignedCertificate ssc, KeyPair keyPair, String hostname) throws Exception {
|
||||
return signKeyPair(
|
||||
ssc,
|
||||
keyPair,
|
||||
hostname,
|
||||
Date.from(Instant.now().minus(Duration.ofDays(1))),
|
||||
Date.from(Instant.now().plus(Duration.ofDays(1))));
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies tha the SSL channel is established as expected, and also sends a message to the server
|
||||
* and verifies if it is echoed back correctly.
|
||||
@@ -110,4 +130,25 @@ public final class SslInitializerTestUtils {
|
||||
// Returns the SSL session for further assertion.
|
||||
return sslHandler.engine().getSession();
|
||||
}
|
||||
|
||||
/** Verifies tha the SSL channel cannot be established due to a given exception. */
|
||||
static void verifySslExcpetion(
|
||||
Channel channel, CheckedConsumer<Channel> operation, Class<? extends Exception> cause)
|
||||
throws Exception {
|
||||
// Extract SSL exception from the handshake future.
|
||||
Exception exception = assertThrows(ExecutionException.class, () -> operation.accept(channel));
|
||||
|
||||
// Verify that the exception is caused by the expected cause.
|
||||
assertThat(Throwables.getRootCause(exception)).isInstanceOf(cause);
|
||||
|
||||
// Ensure that the channel is closed. If this step times out, the channel is not properly
|
||||
// closed.
|
||||
ChannelFuture unusedFuture = channel.closeFuture().syncUninterruptibly();
|
||||
}
|
||||
|
||||
/** A consumer that can throw checked exceptions. */
|
||||
@FunctionalInterface
|
||||
interface CheckedConsumer<T> {
|
||||
void accept(T t) throws Exception;
|
||||
}
|
||||
}
|
||||
|
||||
+70
-14
@@ -18,6 +18,8 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.networking.handler.SslInitializerTestUtils.getKeyPair;
|
||||
import static google.registry.networking.handler.SslInitializerTestUtils.setUpSslChannel;
|
||||
import static google.registry.networking.handler.SslInitializerTestUtils.signKeyPair;
|
||||
import static google.registry.networking.handler.SslInitializerTestUtils.verifySslExcpetion;
|
||||
import static google.registry.networking.handler.SslServerInitializer.CLIENT_CERTIFICATE_PROMISE_KEY;
|
||||
|
||||
import com.google.common.base.Suppliers;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@@ -35,7 +37,12 @@ import io.netty.handler.ssl.util.SelfSignedCertificate;
|
||||
import java.security.KeyPair;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.CertificateExpiredException;
|
||||
import java.security.cert.CertificateNotYetValidException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Date;
|
||||
import javax.net.ssl.SSLEngine;
|
||||
import javax.net.ssl.SSLException;
|
||||
import javax.net.ssl.SSLHandshakeException;
|
||||
@@ -82,18 +89,18 @@ public class SslServerInitializerTest {
|
||||
}
|
||||
|
||||
private ChannelHandler getServerHandler(
|
||||
boolean requireClientCert, PrivateKey privateKey, X509Certificate... certificates) {
|
||||
boolean requireClientCert,
|
||||
boolean validateClientCert,
|
||||
PrivateKey privateKey,
|
||||
X509Certificate... certificates) {
|
||||
return new SslServerInitializer<LocalChannel>(
|
||||
requireClientCert,
|
||||
validateClientCert,
|
||||
sslProvider,
|
||||
Suppliers.ofInstance(privateKey),
|
||||
Suppliers.ofInstance(ImmutableList.copyOf(certificates)));
|
||||
}
|
||||
|
||||
private ChannelHandler getServerHandler(PrivateKey privateKey, X509Certificate... certificates) {
|
||||
return getServerHandler(true, privateKey, certificates);
|
||||
}
|
||||
|
||||
private ChannelHandler getClientHandler(
|
||||
X509Certificate trustedCertificate, PrivateKey privateKey, X509Certificate certificate) {
|
||||
return new ChannelInitializer<LocalChannel>() {
|
||||
@@ -124,6 +131,7 @@ public class SslServerInitializerTest {
|
||||
SslServerInitializer<EmbeddedChannel> sslServerInitializer =
|
||||
new SslServerInitializer<>(
|
||||
true,
|
||||
false,
|
||||
sslProvider,
|
||||
Suppliers.ofInstance(ssc.key()),
|
||||
Suppliers.ofInstance(ImmutableList.of(ssc.cert())));
|
||||
@@ -142,12 +150,13 @@ public class SslServerInitializerTest {
|
||||
SelfSignedCertificate serverSsc = new SelfSignedCertificate(SSL_HOST);
|
||||
LocalAddress localAddress = new LocalAddress("TRUST_ANY_CLIENT_CERT_" + sslProvider);
|
||||
|
||||
nettyRule.setUpServer(localAddress, getServerHandler(serverSsc.key(), serverSsc.cert()));
|
||||
nettyRule.setUpServer(
|
||||
localAddress, getServerHandler(true, false, serverSsc.key(), serverSsc.cert()));
|
||||
SelfSignedCertificate clientSsc = new SelfSignedCertificate();
|
||||
nettyRule.setUpClient(
|
||||
localAddress, getClientHandler(serverSsc.cert(), clientSsc.key(), clientSsc.cert()));
|
||||
|
||||
SSLSession sslSession = setUpSslChannel(nettyRule.getChannel(), serverSsc.cert());
|
||||
SSLSession sslSession = setUpSslChannel(nettyRule.getClientChannel(), serverSsc.cert());
|
||||
nettyRule.assertThatMessagesWork();
|
||||
|
||||
// Verify that the SSL session gets the client cert. Note that this SslSession is for the client
|
||||
@@ -157,15 +166,58 @@ public class SslServerInitializerTest {
|
||||
assertThat(sslSession.getPeerCertificates()).asList().containsExactly(serverSsc.cert());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_clientCertExpired() throws Exception {
|
||||
SelfSignedCertificate serverSsc = new SelfSignedCertificate(SSL_HOST);
|
||||
LocalAddress localAddress = new LocalAddress("CLIENT_CERT_EXPIRED_" + sslProvider);
|
||||
|
||||
nettyRule.setUpServer(
|
||||
localAddress, getServerHandler(true, true, serverSsc.key(), serverSsc.cert()));
|
||||
SelfSignedCertificate clientSsc =
|
||||
new SelfSignedCertificate(
|
||||
"CLIENT",
|
||||
Date.from(Instant.now().minus(Duration.ofDays(2))),
|
||||
Date.from(Instant.now().minus(Duration.ofDays(1))));
|
||||
nettyRule.setUpClient(
|
||||
localAddress, getClientHandler(serverSsc.cert(), clientSsc.key(), clientSsc.cert()));
|
||||
|
||||
verifySslExcpetion(
|
||||
nettyRule.getServerChannel(),
|
||||
channel -> channel.attr(CLIENT_CERTIFICATE_PROMISE_KEY).get().get(),
|
||||
CertificateExpiredException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_clientCertNotYetValid() throws Exception {
|
||||
SelfSignedCertificate serverSsc = new SelfSignedCertificate(SSL_HOST);
|
||||
LocalAddress localAddress = new LocalAddress("CLIENT_CERT_EXPIRED_" + sslProvider);
|
||||
|
||||
nettyRule.setUpServer(
|
||||
localAddress, getServerHandler(true, true, serverSsc.key(), serverSsc.cert()));
|
||||
SelfSignedCertificate clientSsc =
|
||||
new SelfSignedCertificate(
|
||||
"CLIENT",
|
||||
Date.from(Instant.now().plus(Duration.ofDays(1))),
|
||||
Date.from(Instant.now().plus(Duration.ofDays(2))));
|
||||
nettyRule.setUpClient(
|
||||
localAddress, getClientHandler(serverSsc.cert(), clientSsc.key(), clientSsc.cert()));
|
||||
|
||||
verifySslExcpetion(
|
||||
nettyRule.getServerChannel(),
|
||||
channel -> channel.attr(CLIENT_CERTIFICATE_PROMISE_KEY).get().get(),
|
||||
CertificateNotYetValidException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_doesNotRequireClientCert() throws Exception {
|
||||
SelfSignedCertificate serverSsc = new SelfSignedCertificate(SSL_HOST);
|
||||
LocalAddress localAddress = new LocalAddress("DOES_NOT_REQUIRE_CLIENT_CERT_" + sslProvider);
|
||||
|
||||
nettyRule.setUpServer(localAddress, getServerHandler(false, serverSsc.key(), serverSsc.cert()));
|
||||
nettyRule.setUpServer(
|
||||
localAddress, getServerHandler(false, false, serverSsc.key(), serverSsc.cert()));
|
||||
nettyRule.setUpClient(localAddress, getClientHandler(serverSsc.cert(), null, null));
|
||||
|
||||
SSLSession sslSession = setUpSslChannel(nettyRule.getChannel(), serverSsc.cert());
|
||||
SSLSession sslSession = setUpSslChannel(nettyRule.getClientChannel(), serverSsc.cert());
|
||||
nettyRule.assertThatMessagesWork();
|
||||
|
||||
// Verify that the SSL session does not contain any client cert. Note that this SslSession is
|
||||
@@ -186,6 +238,8 @@ public class SslServerInitializerTest {
|
||||
nettyRule.setUpServer(
|
||||
localAddress,
|
||||
getServerHandler(
|
||||
true,
|
||||
false,
|
||||
keyPair.getPrivate(),
|
||||
// Serving both the server cert, and the CA cert
|
||||
serverCert,
|
||||
@@ -197,7 +251,7 @@ public class SslServerInitializerTest {
|
||||
// Client trusts the CA cert
|
||||
caSsc.cert(), clientSsc.key(), clientSsc.cert()));
|
||||
|
||||
SSLSession sslSession = setUpSslChannel(nettyRule.getChannel(), serverCert, caSsc.cert());
|
||||
SSLSession sslSession = setUpSslChannel(nettyRule.getClientChannel(), serverCert, caSsc.cert());
|
||||
nettyRule.assertThatMessagesWork();
|
||||
|
||||
assertThat(sslSession.getLocalCertificates()).asList().containsExactly(clientSsc.cert());
|
||||
@@ -212,7 +266,8 @@ public class SslServerInitializerTest {
|
||||
SelfSignedCertificate serverSsc = new SelfSignedCertificate(SSL_HOST);
|
||||
LocalAddress localAddress = new LocalAddress("REQUIRE_CLIENT_CERT_" + sslProvider);
|
||||
|
||||
nettyRule.setUpServer(localAddress, getServerHandler(serverSsc.key(), serverSsc.cert()));
|
||||
nettyRule.setUpServer(
|
||||
localAddress, getServerHandler(true, false, serverSsc.key(), serverSsc.cert()));
|
||||
nettyRule.setUpClient(
|
||||
localAddress,
|
||||
getClientHandler(
|
||||
@@ -225,7 +280,7 @@ public class SslServerInitializerTest {
|
||||
// should throw exceptions.
|
||||
nettyRule.assertThatServerRootCause().isInstanceOf(SSLHandshakeException.class);
|
||||
nettyRule.assertThatClientRootCause().isInstanceOf(SSLException.class);
|
||||
assertThat(nettyRule.getChannel().isActive()).isFalse();
|
||||
assertThat(nettyRule.getClientChannel().isActive()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -233,7 +288,8 @@ public class SslServerInitializerTest {
|
||||
SelfSignedCertificate serverSsc = new SelfSignedCertificate("wrong.com");
|
||||
LocalAddress localAddress = new LocalAddress("WRONG_HOSTNAME_" + sslProvider);
|
||||
|
||||
nettyRule.setUpServer(localAddress, getServerHandler(serverSsc.key(), serverSsc.cert()));
|
||||
nettyRule.setUpServer(
|
||||
localAddress, getServerHandler(true, false, serverSsc.key(), serverSsc.cert()));
|
||||
SelfSignedCertificate clientSsc = new SelfSignedCertificate();
|
||||
nettyRule.setUpClient(
|
||||
localAddress, getClientHandler(serverSsc.cert(), clientSsc.key(), clientSsc.cert()));
|
||||
@@ -243,6 +299,6 @@ public class SslServerInitializerTest {
|
||||
nettyRule.assertThatClientRootCause().isInstanceOf(CertificateException.class);
|
||||
nettyRule.assertThatClientRootCause().hasMessageThat().contains(SSL_HOST);
|
||||
nettyRule.assertThatServerRootCause().isInstanceOf(SSLException.class);
|
||||
assertThat(nettyRule.getChannel().isActive()).isFalse();
|
||||
assertThat(nettyRule.getClientChannel().isActive()).isFalse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.code.gson:gson:2.8.5
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.flogger:flogger-system-backend:0.1
|
||||
com.google.flogger:flogger:0.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.re2j:re2j:1.1
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.netty:netty-buffer:4.1.31.Final
|
||||
io.netty:netty-codec-http:4.1.31.Final
|
||||
io.netty:netty-codec:4.1.31.Final
|
||||
io.netty:netty-common:4.1.31.Final
|
||||
io.netty:netty-handler:4.1.31.Final
|
||||
io.netty:netty-resolver:4.1.31.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.22.Final
|
||||
io.netty:netty-transport:4.1.31.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.activation:activation:1.1
|
||||
javax.inject:javax.inject:1
|
||||
javax.mail:mail:1.4
|
||||
javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpkix-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
xerces:xmlParserAPIs:2.6.2
|
||||
xpp3:xpp3:1.1.4c
|
||||
@@ -0,0 +1,57 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.beust:jcommander:1.60
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.9
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.apis:google-api-services-cloudkms:v1-rev12-1.22.0
|
||||
com.google.apis:google-api-services-monitoring:v3-rev426-1.23.0
|
||||
com.google.apis:google-api-services-storage:v1-rev150-1.22.0
|
||||
com.google.appengine:appengine-api-1.0-sdk:1.9.48
|
||||
com.google.appengine:appengine-testing:1.9.58
|
||||
com.google.auth:google-auth-library-credentials:0.16.1
|
||||
com.google.auth:google-auth-library-oauth2-http:0.16.1
|
||||
com.google.auto.value:auto-value-annotations:1.6.3
|
||||
com.google.auto.value:auto-value:1.6.3
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.code.gson:gson:2.8.5
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotations:2.3.2
|
||||
com.google.flogger:flogger-system-backend:0.1
|
||||
com.google.flogger:flogger:0.1
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.re2j:re2j:1.1
|
||||
com.ibm.icu:icu4j:57.1
|
||||
commons-codec:commons-codec:1.11
|
||||
commons-logging:commons-logging:1.2
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.netty:netty-buffer:4.1.31.Final
|
||||
io.netty:netty-codec-http:4.1.31.Final
|
||||
io.netty:netty-codec:4.1.31.Final
|
||||
io.netty:netty-common:4.1.31.Final
|
||||
io.netty:netty-handler:4.1.31.Final
|
||||
io.netty:netty-resolver:4.1.31.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.22.Final
|
||||
io.netty:netty-transport:4.1.31.Final
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
javax.activation:activation:1.1
|
||||
javax.inject:javax.inject:1
|
||||
javax.mail:mail:1.4
|
||||
javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpkix-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
@@ -162,7 +162,8 @@ public final class EppProtocolModule {
|
||||
SslProvider sslProvider,
|
||||
Supplier<PrivateKey> privateKeySupplier,
|
||||
Supplier<ImmutableList<X509Certificate>> certificatesSupplier) {
|
||||
return new SslServerInitializer<>(true, sslProvider, privateKeySupplier, certificatesSupplier);
|
||||
return new SslServerInitializer<>(
|
||||
true, false, sslProvider, privateKeySupplier, certificatesSupplier);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
||||
@@ -134,6 +134,7 @@ public final class WebWhoisProtocolsModule {
|
||||
SslProvider sslProvider,
|
||||
Supplier<PrivateKey> privateKeySupplier,
|
||||
Supplier<ImmutableList<X509Certificate>> certificatesSupplier) {
|
||||
return new SslServerInitializer<>(false, sslProvider, privateKeySupplier, certificatesSupplier);
|
||||
return new SslServerInitializer<>(
|
||||
false, false, sslProvider, privateKeySupplier, certificatesSupplier);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ steps:
|
||||
# Build and package the deployment files for production.
|
||||
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
||||
args: ['release/build_nomulus_for_env.sh', 'production', 'output']
|
||||
# Tentatively build and publish Cloud SQL schema jar here, before schema release
|
||||
# process is finalized.
|
||||
# Tentatively build Cloud SQL schema jar here, before schema release process
|
||||
# is finalized.
|
||||
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
||||
entrypoint: /bin/bash
|
||||
args:
|
||||
@@ -74,11 +74,9 @@ steps:
|
||||
- |
|
||||
set -e
|
||||
./gradlew \
|
||||
:db:publish \
|
||||
:db:schemaJar \
|
||||
-PmavenUrl=https://storage.googleapis.com/domain-registry-maven-repository/maven \
|
||||
-PpluginsUrl=https://storage.googleapis.com/domain-registry-maven-repository/plugins \
|
||||
-Pschema_publish_repo=gcs://domain-registry-maven-repository/nomulus \
|
||||
-Pschema_version=${TAG_NAME}
|
||||
-PpluginsUrl=https://storage.googleapis.com/domain-registry-maven-repository/plugins
|
||||
cp db/build/libs/schema.jar output/
|
||||
# The tarballs and jars to upload to GCS.
|
||||
artifacts:
|
||||
|
||||
@@ -218,7 +218,6 @@ org.jetbrains:annotations:17.0.0
|
||||
org.joda:joda-money:1.0.1
|
||||
org.json:json:20160810
|
||||
org.jvnet.staxex:stax-ex:1.8
|
||||
org.mockito:mockito-core:1.9.5
|
||||
org.mortbay.jetty:jetty-util:6.1.26
|
||||
org.mortbay.jetty:jetty:6.1.26
|
||||
org.objenesis:objenesis:1.2
|
||||
|
||||
@@ -10,6 +10,14 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-databind:2.9.10
|
||||
com.fasterxml:classmate:1.3.4
|
||||
com.github.jnr:jffi:1.2.17
|
||||
com.github.jnr:jnr-a64asm:1.0.0
|
||||
com.github.jnr:jnr-constants:0.9.11
|
||||
com.github.jnr:jnr-enxio:0.19
|
||||
com.github.jnr:jnr-ffi:2.1.9
|
||||
com.github.jnr:jnr-posix:3.0.47
|
||||
com.github.jnr:jnr-unixsocket:0.21
|
||||
com.github.jnr:jnr-x86asm:1.0.2
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
@@ -50,6 +58,7 @@ com.google.apis:google-api-services-groupssettings:v1-rev60-1.22.0
|
||||
com.google.apis:google-api-services-monitoring:v3-rev426-1.23.0
|
||||
com.google.apis:google-api-services-pubsub:v1-rev20181105-1.27.0
|
||||
com.google.apis:google-api-services-sheets:v4-rev483-1.22.0
|
||||
com.google.apis:google-api-services-sqladmin:v1beta4-rev56-1.23.0
|
||||
com.google.apis:google-api-services-storage:v1-rev20181109-1.27.0
|
||||
com.google.appengine.tools:appengine-gcs-client:0.6
|
||||
com.google.appengine.tools:appengine-mapreduce:0.9
|
||||
@@ -65,6 +74,8 @@ com.google.cloud.bigdataoss:gcsio:1.9.16
|
||||
com.google.cloud.bigdataoss:util:1.9.16
|
||||
com.google.cloud.bigtable:bigtable-client-core:1.8.0
|
||||
com.google.cloud.datastore:datastore-v1-proto-client:1.6.0
|
||||
com.google.cloud.sql:jdbc-socket-factory-core:1.0.12
|
||||
com.google.cloud.sql:postgres-socket-factory:1.0.12
|
||||
com.google.cloud:google-cloud-bigquerystorage:0.79.0-alpha
|
||||
com.google.cloud:google-cloud-bigtable-admin:0.73.0-alpha
|
||||
com.google.cloud:google-cloud-bigtable:0.73.0-alpha
|
||||
@@ -206,15 +217,14 @@ org.jetbrains:annotations:17.0.0
|
||||
org.joda:joda-money:1.0.1
|
||||
org.json:json:20160810
|
||||
org.jvnet.staxex:stax-ex:1.8
|
||||
org.mockito:mockito-core:1.9.5
|
||||
org.mortbay.jetty:jetty-util:6.1.26
|
||||
org.mortbay.jetty:jetty:6.1.26
|
||||
org.objenesis:objenesis:1.2
|
||||
org.ow2.asm:asm-analysis:6.0
|
||||
org.ow2.asm:asm-analysis:7.0
|
||||
org.ow2.asm:asm-commons:6.0
|
||||
org.ow2.asm:asm-tree:6.0
|
||||
org.ow2.asm:asm-util:6.0
|
||||
org.ow2.asm:asm:6.0
|
||||
org.ow2.asm:asm-tree:7.0
|
||||
org.ow2.asm:asm-util:7.0
|
||||
org.ow2.asm:asm:7.0
|
||||
org.postgresql:postgresql:42.2.6
|
||||
org.rnorth.duct-tape:duct-tape:1.0.8
|
||||
org.rnorth.visible-assertions:visible-assertions:2.1.2
|
||||
|
||||
@@ -218,7 +218,6 @@ org.jetbrains:annotations:17.0.0
|
||||
org.joda:joda-money:1.0.1
|
||||
org.json:json:20160810
|
||||
org.jvnet.staxex:stax-ex:1.8
|
||||
org.mockito:mockito-core:1.9.5
|
||||
org.mortbay.jetty:jetty-util:6.1.26
|
||||
org.mortbay.jetty:jetty:6.1.26
|
||||
org.objenesis:objenesis:1.2
|
||||
|
||||
@@ -218,7 +218,6 @@ org.jetbrains:annotations:17.0.0
|
||||
org.joda:joda-money:1.0.1
|
||||
org.json:json:20160810
|
||||
org.jvnet.staxex:stax-ex:1.8
|
||||
org.mockito:mockito-core:1.9.5
|
||||
org.mortbay.jetty:jetty-util:6.1.26
|
||||
org.mortbay.jetty:jetty:6.1.26
|
||||
org.objenesis:objenesis:1.2
|
||||
|
||||
@@ -218,7 +218,6 @@ org.jetbrains:annotations:17.0.0
|
||||
org.joda:joda-money:1.0.1
|
||||
org.json:json:20160810
|
||||
org.jvnet.staxex:stax-ex:1.8
|
||||
org.mockito:mockito-core:1.9.5
|
||||
org.mortbay.jetty:jetty-util:6.1.26
|
||||
org.mortbay.jetty:jetty:6.1.26
|
||||
org.objenesis:objenesis:1.2
|
||||
|
||||
@@ -218,7 +218,6 @@ org.jetbrains:annotations:17.0.0
|
||||
org.joda:joda-money:1.0.1
|
||||
org.json:json:20160810
|
||||
org.jvnet.staxex:stax-ex:1.8
|
||||
org.mockito:mockito-core:1.9.5
|
||||
org.mortbay.jetty:jetty-util:6.1.26
|
||||
org.mortbay.jetty:jetty:6.1.26
|
||||
org.objenesis:objenesis:1.2
|
||||
|
||||
@@ -10,6 +10,14 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-databind:2.9.10
|
||||
com.fasterxml:classmate:1.3.4
|
||||
com.github.jnr:jffi:1.2.17
|
||||
com.github.jnr:jnr-a64asm:1.0.0
|
||||
com.github.jnr:jnr-constants:0.9.11
|
||||
com.github.jnr:jnr-enxio:0.19
|
||||
com.github.jnr:jnr-ffi:2.1.9
|
||||
com.github.jnr:jnr-posix:3.0.47
|
||||
com.github.jnr:jnr-unixsocket:0.21
|
||||
com.github.jnr:jnr-x86asm:1.0.2
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
@@ -50,6 +58,7 @@ com.google.apis:google-api-services-groupssettings:v1-rev60-1.22.0
|
||||
com.google.apis:google-api-services-monitoring:v3-rev426-1.23.0
|
||||
com.google.apis:google-api-services-pubsub:v1-rev20181105-1.27.0
|
||||
com.google.apis:google-api-services-sheets:v4-rev483-1.22.0
|
||||
com.google.apis:google-api-services-sqladmin:v1beta4-rev56-1.23.0
|
||||
com.google.apis:google-api-services-storage:v1-rev20181109-1.27.0
|
||||
com.google.appengine.tools:appengine-gcs-client:0.6
|
||||
com.google.appengine.tools:appengine-mapreduce:0.9
|
||||
@@ -65,6 +74,8 @@ com.google.cloud.bigdataoss:gcsio:1.9.16
|
||||
com.google.cloud.bigdataoss:util:1.9.16
|
||||
com.google.cloud.bigtable:bigtable-client-core:1.8.0
|
||||
com.google.cloud.datastore:datastore-v1-proto-client:1.6.0
|
||||
com.google.cloud.sql:jdbc-socket-factory-core:1.0.12
|
||||
com.google.cloud.sql:postgres-socket-factory:1.0.12
|
||||
com.google.cloud:google-cloud-bigquerystorage:0.79.0-alpha
|
||||
com.google.cloud:google-cloud-bigtable-admin:0.73.0-alpha
|
||||
com.google.cloud:google-cloud-bigtable:0.73.0-alpha
|
||||
@@ -206,15 +217,14 @@ org.jetbrains:annotations:17.0.0
|
||||
org.joda:joda-money:1.0.1
|
||||
org.json:json:20160810
|
||||
org.jvnet.staxex:stax-ex:1.8
|
||||
org.mockito:mockito-core:1.9.5
|
||||
org.mortbay.jetty:jetty-util:6.1.26
|
||||
org.mortbay.jetty:jetty:6.1.26
|
||||
org.objenesis:objenesis:1.2
|
||||
org.ow2.asm:asm-analysis:6.0
|
||||
org.ow2.asm:asm-analysis:7.0
|
||||
org.ow2.asm:asm-commons:6.0
|
||||
org.ow2.asm:asm-tree:6.0
|
||||
org.ow2.asm:asm-util:6.0
|
||||
org.ow2.asm:asm:6.0
|
||||
org.ow2.asm:asm-tree:7.0
|
||||
org.ow2.asm:asm-util:7.0
|
||||
org.ow2.asm:asm:7.0
|
||||
org.postgresql:postgresql:42.2.6
|
||||
org.rnorth.duct-tape:duct-tape:1.0.8
|
||||
org.rnorth.visible-assertions:visible-assertions:2.1.2
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user