Setup auth settings in PublishDetailReports @Action to support tool access

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155459413
This commit is contained in:
jianglai 2017-05-08 19:18:32 -07:00 committed by Ben McIlwain
parent d419f6ac11
commit 5313ca58d6
2 changed files with 10 additions and 3 deletions

View file

@ -16,11 +16,11 @@ java_library(
"//java/google/registry/mapreduce/inputs",
"//java/google/registry/model",
"//java/google/registry/request",
"//java/google/registry/request/auth",
"//java/google/registry/storage/drive",
"//java/google/registry/util",
"//third_party/java/objectify:objectify-v4_1",
"@com_google_api_client",
"@com_google_api_client_appengine",
"@com_google_apis_google_api_services_bigquery",
"@com_google_apis_google_api_services_drive",
"@com_google_appengine_api_1_0_sdk",
@ -30,8 +30,6 @@ java_library(
"@com_google_dagger",
"@com_google_guava",
"@com_google_http_client",
"@com_google_http_client_appengine",
"@com_google_http_client_jackson2",
"@com_googlecode_json_simple",
"@javax_servlet_api",
"@joda_time",

View file

@ -28,6 +28,10 @@ import google.registry.request.HttpException.BadRequestException;
import google.registry.request.HttpException.InternalServerErrorException;
import google.registry.request.JsonActionRunner;
import google.registry.request.JsonActionRunner.JsonAction;
import google.registry.request.auth.Auth;
import google.registry.request.auth.Auth.AuthMethod;
import google.registry.request.auth.Auth.UserPolicy;
import google.registry.request.auth.AuthLevel;
import google.registry.storage.drive.DriveConnection;
import google.registry.util.FormattingLogger;
import java.io.FileNotFoundException;
@ -39,6 +43,11 @@ import javax.inject.Inject;
@Action(
path = PublishDetailReportAction.PATH,
method = Action.Method.POST,
auth = @Auth(
methods = {AuthMethod.INTERNAL, Auth.AuthMethod.API},
minimumLevel = AuthLevel.APP,
userPolicy = UserPolicy.ADMIN
),
xsrfProtection = true,
xsrfScope = "admin")
public final class PublishDetailReportAction implements Runnable, JsonAction {