mirror of
https://github.com/google/nomulus.git
synced 2025-06-24 05:11:10 +02:00
EppConsoleAction still "manually" checks access by going over the RegistrarContacts. We need it to use AuthenticatedRegistrarAccessor just like every other part of the registrar console. We still need to remove the (now unneeded) login EPP sent by the console, but that's left for a followup CL. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=222404208
44 lines
1.5 KiB
Java
44 lines
1.5 KiB
Java
// 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.ui.server.registrar;
|
|
|
|
|
|
import static google.registry.request.RequestParameters.extractOptionalParameter;
|
|
import static google.registry.request.RequestParameters.extractRequiredParameter;
|
|
|
|
import dagger.Module;
|
|
import dagger.Provides;
|
|
import google.registry.request.Parameter;
|
|
import java.util.Optional;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
/** Dagger module for the Registrar Console parameters. */
|
|
@Module
|
|
public final class RegistrarConsoleModule {
|
|
|
|
static final String PARAM_CLIENT_ID = "clientId";
|
|
|
|
@Provides
|
|
@Parameter(PARAM_CLIENT_ID)
|
|
static Optional<String> provideOptionalClientId(HttpServletRequest req) {
|
|
return extractOptionalParameter(req, PARAM_CLIENT_ID);
|
|
}
|
|
|
|
@Provides
|
|
@Parameter(PARAM_CLIENT_ID)
|
|
static String provideClientId(HttpServletRequest req) {
|
|
return extractRequiredParameter(req, PARAM_CLIENT_ID);
|
|
}
|
|
}
|