From 9097a32cc8e26daba3f4766cf83f384e29873d49 Mon Sep 17 00:00:00 2001 From: mcilwain Date: Wed, 13 Jun 2018 13:15:26 -0700 Subject: [PATCH] Remove web & protocol WHOIS, check API, and RDAP from frontend These are now handled by the pubapi service and all publicly facing sites that were using these APIs have already been migrated over. For documentation on the newly added dispatch.xml file, see: https://cloud.google.com/appengine/docs/standard/java/config/dispatchref Note that the --auto_update_dispatch parameter needs to be passed to the `appcfg update` command in order to apply this new XML file. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=200441580 --- java/google/registry/BUILD | 1 + .../env/common/default/WEB-INF/dispatch.xml | 20 +++++++++++ .../env/common/default/WEB-INF/web.xml | 33 ----------------- java/google/registry/module/frontend/BUILD | 2 -- .../module/frontend/FrontendComponent.java | 1 - .../frontend/FrontendMetricsModule.java | 25 ------------- .../frontend/FrontendRequestComponent.java | 36 ------------------- .../module/pubapi/PubApiComponent.java | 1 - .../module/pubapi/PubApiMetricsModule.java | 25 ------------- .../frontend/testdata/frontend_routing.txt | 27 ++++---------- 10 files changed, 28 insertions(+), 143 deletions(-) create mode 100644 java/google/registry/env/common/default/WEB-INF/dispatch.xml delete mode 100644 java/google/registry/module/frontend/FrontendMetricsModule.java delete mode 100644 java/google/registry/module/pubapi/PubApiMetricsModule.java diff --git a/java/google/registry/BUILD b/java/google/registry/BUILD index a76e2bee2..c1ff37f8a 100644 --- a/java/google/registry/BUILD +++ b/java/google/registry/BUILD @@ -68,6 +68,7 @@ zip_file( name = "registry_default_war", srcs = [ "env/common/default/WEB-INF/datastore-indexes.xml", + "env/common/default/WEB-INF/dispatch.xml", "env/common/default/WEB-INF/dos.xml", "env/common/default/WEB-INF/logging.properties", "env/common/default/WEB-INF/queue.xml", diff --git a/java/google/registry/env/common/default/WEB-INF/dispatch.xml b/java/google/registry/env/common/default/WEB-INF/dispatch.xml new file mode 100644 index 000000000..2a80187bb --- /dev/null +++ b/java/google/registry/env/common/default/WEB-INF/dispatch.xml @@ -0,0 +1,20 @@ + + + + + */rdap/* + pubapi + + + */whois/* + pubapi + + + */_dr/whois + pubapi + + + */check + pubapi + + diff --git a/java/google/registry/env/common/default/WEB-INF/web.xml b/java/google/registry/env/common/default/WEB-INF/web.xml index c2e5ef808..fb123396e 100644 --- a/java/google/registry/env/common/default/WEB-INF/web.xml +++ b/java/google/registry/env/common/default/WEB-INF/web.xml @@ -49,39 +49,6 @@ /registrar-settings - - - frontend-servlet - /whois/* - - - - - frontend-servlet - /_dr/whois - - - - - frontend-servlet - /rdap/* - - - - - frontend-servlet - /check - - - - - frontend-servlet - /check2 - - diff --git a/java/google/registry/module/frontend/BUILD b/java/google/registry/module/frontend/BUILD index d3162f06d..b79a8db06 100644 --- a/java/google/registry/module/frontend/BUILD +++ b/java/google/registry/module/frontend/BUILD @@ -15,14 +15,12 @@ java_library( "//java/google/registry/keyring/api", "//java/google/registry/keyring/kms", "//java/google/registry/monitoring/whitebox", - "//java/google/registry/rdap", "//java/google/registry/request", "//java/google/registry/request:modules", "//java/google/registry/request/auth", "//java/google/registry/ui", "//java/google/registry/ui/server/registrar", "//java/google/registry/util", - "//java/google/registry/whois", "@com_google_appengine_api_1_0_sdk", "@com_google_code_findbugs_jsr305", "@com_google_dagger", diff --git a/java/google/registry/module/frontend/FrontendComponent.java b/java/google/registry/module/frontend/FrontendComponent.java index 9835b4c4a..93410de45 100644 --- a/java/google/registry/module/frontend/FrontendComponent.java +++ b/java/google/registry/module/frontend/FrontendComponent.java @@ -50,7 +50,6 @@ import javax.inject.Singleton; ConsoleConfigModule.class, CustomLogicFactoryModule.class, google.registry.keyring.api.DummyKeyringModule.class, - FrontendMetricsModule.class, FrontendRequestComponentModule.class, GoogleCredentialModule.class, Jackson2Module.class, diff --git a/java/google/registry/module/frontend/FrontendMetricsModule.java b/java/google/registry/module/frontend/FrontendMetricsModule.java deleted file mode 100644 index 3e77b87cb..000000000 --- a/java/google/registry/module/frontend/FrontendMetricsModule.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 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.module.frontend; - -import dagger.Module; -import javax.inject.Singleton; - -/** - * Dagger module for injecting metrics. All metrics should have {@link Singleton} scope to avoid - * being recreated per-request, as the metrics generally track cumulative values. - */ -@Module -public class FrontendMetricsModule {} diff --git a/java/google/registry/module/frontend/FrontendRequestComponent.java b/java/google/registry/module/frontend/FrontendRequestComponent.java index fe86a0ece..badeb2131 100644 --- a/java/google/registry/module/frontend/FrontendRequestComponent.java +++ b/java/google/registry/module/frontend/FrontendRequestComponent.java @@ -17,25 +17,11 @@ package google.registry.module.frontend; import dagger.Module; import dagger.Subcomponent; import google.registry.dns.DnsModule; -import google.registry.flows.CheckApi2Action; -import google.registry.flows.CheckApi2Action.CheckApi2Module; -import google.registry.flows.CheckApiAction; -import google.registry.flows.CheckApiAction.CheckApiModule; import google.registry.flows.EppConsoleAction; import google.registry.flows.EppTlsAction; import google.registry.flows.FlowComponent; import google.registry.flows.TlsCredentials.EppTlsModule; import google.registry.monitoring.whitebox.WhiteboxModule; -import google.registry.rdap.RdapAutnumAction; -import google.registry.rdap.RdapDomainAction; -import google.registry.rdap.RdapDomainSearchAction; -import google.registry.rdap.RdapEntityAction; -import google.registry.rdap.RdapEntitySearchAction; -import google.registry.rdap.RdapHelpAction; -import google.registry.rdap.RdapIpAction; -import google.registry.rdap.RdapModule; -import google.registry.rdap.RdapNameserverAction; -import google.registry.rdap.RdapNameserverSearchAction; import google.registry.request.RequestComponentBuilder; import google.registry.request.RequestModule; import google.registry.request.RequestScope; @@ -43,46 +29,24 @@ import google.registry.ui.server.registrar.ConsoleUiAction; import google.registry.ui.server.registrar.RegistrarPaymentAction; import google.registry.ui.server.registrar.RegistrarPaymentSetupAction; import google.registry.ui.server.registrar.RegistrarSettingsAction; -import google.registry.whois.WhoisAction; -import google.registry.whois.WhoisHttpAction; -import google.registry.whois.WhoisModule; /** Dagger component with per-request lifetime for "default" App Engine module. */ @RequestScope @Subcomponent( modules = { - CheckApiModule.class, - CheckApi2Module.class, DnsModule.class, EppTlsModule.class, - RdapModule.class, RequestModule.class, WhiteboxModule.class, - WhoisModule.class, }) interface FrontendRequestComponent { - CheckApiAction checkApiAction(); - CheckApi2Action checkApi2Action(); ConsoleUiAction consoleUiAction(); EppConsoleAction eppConsoleAction(); EppTlsAction eppTlsAction(); FlowComponent.Builder flowComponentBuilder(); - RdapAutnumAction rdapAutnumAction(); RegistrarPaymentAction registrarPaymentAction(); RegistrarPaymentSetupAction registrarPaymentSetupAction(); RegistrarSettingsAction registrarSettingsAction(); - RdapDomainAction rdapDomainAction(); - RdapDomainSearchAction rdapDomainSearchAction(); - RdapEntityAction rdapEntityAction(); - RdapEntitySearchAction rdapEntitySearchAction(); - RdapHelpAction rdapHelpAction(); - RdapIpAction rdapDefaultAction(); - RdapNameserverAction rdapNameserverAction(); - RdapNameserverSearchAction rdapNameserverSearchAction(); - - WhoisHttpAction whoisHttpAction(); - - WhoisAction whoisAction(); @Subcomponent.Builder abstract class Builder implements RequestComponentBuilder { diff --git a/java/google/registry/module/pubapi/PubApiComponent.java b/java/google/registry/module/pubapi/PubApiComponent.java index d1edf4172..608837997 100644 --- a/java/google/registry/module/pubapi/PubApiComponent.java +++ b/java/google/registry/module/pubapi/PubApiComponent.java @@ -47,7 +47,6 @@ import javax.inject.Singleton; ConfigModule.class, CustomLogicFactoryModule.class, google.registry.keyring.api.DummyKeyringModule.class, - PubApiMetricsModule.class, PubApiRequestComponentModule.class, GoogleCredentialModule.class, Jackson2Module.class, diff --git a/java/google/registry/module/pubapi/PubApiMetricsModule.java b/java/google/registry/module/pubapi/PubApiMetricsModule.java deleted file mode 100644 index d2e5b9cc2..000000000 --- a/java/google/registry/module/pubapi/PubApiMetricsModule.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2018 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.module.pubapi; - -import dagger.Module; -import javax.inject.Singleton; - -/** - * Dagger module for injecting metrics. All metrics should have {@link Singleton} scope to avoid - * being recreated per-request, as the metrics generally track cumulative values. - */ -@Module -public class PubApiMetricsModule {} diff --git a/javatests/google/registry/module/frontend/testdata/frontend_routing.txt b/javatests/google/registry/module/frontend/testdata/frontend_routing.txt index 9cb3fa248..44a7a46c7 100644 --- a/javatests/google/registry/module/frontend/testdata/frontend_routing.txt +++ b/javatests/google/registry/module/frontend/testdata/frontend_routing.txt @@ -1,20 +1,7 @@ -PATH CLASS METHODS OK AUTH_METHODS MIN USER_POLICY -/_dr/epp EppTlsAction POST n INTERNAL,API APP PUBLIC -/_dr/whois WhoisAction POST n INTERNAL,API APP PUBLIC -/check CheckApiAction GET n INTERNAL NONE PUBLIC -/check2 CheckApi2Action GET n INTERNAL NONE PUBLIC -/rdap/autnum/(*) RdapAutnumAction GET,HEAD n INTERNAL NONE PUBLIC -/rdap/domain/(*) RdapDomainAction GET,HEAD n INTERNAL,API,LEGACY NONE PUBLIC -/rdap/domains RdapDomainSearchAction GET,HEAD n INTERNAL,API,LEGACY NONE PUBLIC -/rdap/entities RdapEntitySearchAction GET,HEAD n INTERNAL,API,LEGACY NONE PUBLIC -/rdap/entity/(*) RdapEntityAction GET,HEAD n INTERNAL,API,LEGACY NONE PUBLIC -/rdap/help(*) RdapHelpAction GET,HEAD n INTERNAL NONE PUBLIC -/rdap/ip/(*) RdapIpAction GET,HEAD n INTERNAL NONE PUBLIC -/rdap/nameserver/(*) RdapNameserverAction GET,HEAD n INTERNAL NONE PUBLIC -/rdap/nameservers RdapNameserverSearchAction GET,HEAD n INTERNAL NONE PUBLIC -/registrar ConsoleUiAction GET n INTERNAL,API,LEGACY NONE PUBLIC -/registrar-payment RegistrarPaymentAction POST n API,LEGACY USER PUBLIC -/registrar-payment-setup RegistrarPaymentSetupAction POST n API,LEGACY USER PUBLIC -/registrar-settings RegistrarSettingsAction POST n API,LEGACY USER PUBLIC -/registrar-xhr EppConsoleAction POST n API,LEGACY USER PUBLIC -/whois/(*) WhoisHttpAction GET n INTERNAL NONE PUBLIC +PATH CLASS METHODS OK AUTH_METHODS MIN USER_POLICY +/_dr/epp EppTlsAction POST n INTERNAL,API APP PUBLIC +/registrar ConsoleUiAction GET n INTERNAL,API,LEGACY NONE PUBLIC +/registrar-payment RegistrarPaymentAction POST n API,LEGACY USER PUBLIC +/registrar-payment-setup RegistrarPaymentSetupAction POST n API,LEGACY USER PUBLIC +/registrar-settings RegistrarSettingsAction POST n API,LEGACY USER PUBLIC +/registrar-xhr EppConsoleAction POST n API,LEGACY USER PUBLIC