Enable authentication/authorization checks

The code to authenticate and authorize incoming requests (including via OAuth) has been in the system. This CL actually turns it on, since we are satisfied from logging information that it is not unjustly denying access.

Auth settings are also updated on a few commands missed earlier.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152381820
This commit is contained in:
mountford 2017-04-06 07:59:15 -07:00 committed by Ben McIlwain
parent bd696b4b92
commit 5127aeafb5
7 changed files with 40 additions and 42 deletions

View file

@ -47,6 +47,8 @@ import google.registry.model.host.HostResource;
import google.registry.request.Action;
import google.registry.request.HttpException.BadRequestException;
import google.registry.request.JsonActionRunner;
import google.registry.request.auth.Auth;
import google.registry.request.auth.AuthLevel;
import google.registry.util.Clock;
import java.io.IOException;
import java.io.OutputStream;
@ -72,8 +74,13 @@ import org.joda.time.Duration;
@Action(
path = GenerateZoneFilesAction.PATH,
method = POST,
xsrfProtection = true,
xsrfScope = "admin")
auth =
@Auth(
methods = {Auth.AuthMethod.INTERNAL, Auth.AuthMethod.API},
minimumLevel = AuthLevel.APP,
userPolicy = Auth.UserPolicy.ADMIN
)
)
public class GenerateZoneFilesAction implements Runnable, JsonActionRunner.JsonAction {
public static final String PATH = "/_dr/task/generateZoneFiles";