diff --git a/java/google/registry/request/auth/RequestAuthenticator.java b/java/google/registry/request/auth/RequestAuthenticator.java index 747777b07..8222d821f 100644 --- a/java/google/registry/request/auth/RequestAuthenticator.java +++ b/java/google/registry/request/auth/RequestAuthenticator.java @@ -158,22 +158,22 @@ public class RequestAuthenticator { private AuthResult authenticate(AuthSettings auth, HttpServletRequest req) { checkAuthConfig(auth); for (AuthMethod authMethod : auth.methods()) { + AuthResult authResult; switch (authMethod) { - // App Engine internal authentication, using the queue name header - case INTERNAL: { - // checkAuthConfig will have insured that the user policy is not USER. - AuthResult authResult = appEngineInternalAuthenticationMechanism.authenticate(req); - if (authResult.isAuthenticated()) { - logger.atInfo().log("Authenticated via internal auth: %s", authResult); - return authResult; - } + // App Engine internal authentication, using the queue name header + case INTERNAL: + // checkAuthConfig will have insured that the user policy is not USER. + authResult = appEngineInternalAuthenticationMechanism.authenticate(req); + if (authResult.isAuthenticated()) { + logger.atInfo().log("Authenticated via internal auth: %s", authResult); + return authResult; } break; // API-based user authentication mechanisms, such as OAuth case API: // checkAuthConfig will have insured that the user policy is not IGNORED. for (AuthenticationMechanism authMechanism : apiAuthenticationMechanisms) { - AuthResult authResult = authMechanism.authenticate(req); + authResult = authMechanism.authenticate(req); if (authResult.isAuthenticated()) { logger.atInfo().log( "Authenticated via %s: %s", authMechanism.getClass().getSimpleName(), authResult); @@ -184,7 +184,7 @@ public class RequestAuthenticator { // Legacy authentication via UserService case LEGACY: // checkAuthConfig will have insured that the user policy is not IGNORED. - AuthResult authResult = legacyAuthenticationMechanism.authenticate(req); + authResult = legacyAuthenticationMechanism.authenticate(req); if (authResult.isAuthenticated()) { logger.atInfo().log("Authenticated via legacy auth: %s", authResult); return authResult; diff --git a/java/google/registry/tools/CreateOrUpdateRegistrarCommand.java b/java/google/registry/tools/CreateOrUpdateRegistrarCommand.java index c7a095b22..9a55cc051 100644 --- a/java/google/registry/tools/CreateOrUpdateRegistrarCommand.java +++ b/java/google/registry/tools/CreateOrUpdateRegistrarCommand.java @@ -183,15 +183,14 @@ abstract class CreateOrUpdateRegistrarCommand extends MutatingCommand { @Nullable @Parameter( - names = "--billing_account_map", - description = - "Registrar Billing Account key-value pairs (formatted as key=value[,key=value...]), " - + "where key is a currency unit (USD, JPY, etc) and value is the registrar's billing " - + "account id for that currency. During update, only the pairs that need updating need " - + "to be provided.", - converter = CurrencyUnitToStringMap.class, - validateWith = CurrencyUnitToStringMap.class - ) + names = "--billing_account_map", + description = + "Registrar Billing Account key-value pairs (formatted as key=value[,key=value...]), " + + "where key is a currency unit (USD, JPY, etc) and value is the registrar's billing " + + "account id for that currency. During update, only the pairs that need updating " + + "need to be provided.", + converter = CurrencyUnitToStringMap.class, + validateWith = CurrencyUnitToStringMap.class) private Map billingAccountMap; @Nullable diff --git a/java/google/registry/tools/CreateOrUpdateTldCommand.java b/java/google/registry/tools/CreateOrUpdateTldCommand.java index f12883336..4c4c8386c 100644 --- a/java/google/registry/tools/CreateOrUpdateTldCommand.java +++ b/java/google/registry/tools/CreateOrUpdateTldCommand.java @@ -307,8 +307,9 @@ abstract class CreateOrUpdateTldCommand extends MutatingCommand { if (renewBillingCostTransitions.size() > 1) { System.err.println( "----------------------\n" - + "WARNING: Do not set multiple renew cost transitions until b/20764952 is fixed.\n" - + "----------------------\n"); + + "WARNING: Do not set multiple renew cost transitions " + + "until b/20764952 is fixed.\n" + + "----------------------\n"); } builder.setRenewBillingCostTransitions(renewBillingCostTransitions); } diff --git a/java/google/registry/tools/GenerateAllocationTokensCommand.java b/java/google/registry/tools/GenerateAllocationTokensCommand.java index f0c84fbbf..773a56352 100644 --- a/java/google/registry/tools/GenerateAllocationTokensCommand.java +++ b/java/google/registry/tools/GenerateAllocationTokensCommand.java @@ -44,10 +44,10 @@ import javax.inject.Named; /** Command to generate and persist {@link AllocationToken}s. */ @Parameters( - separators = " =", - commandDescription = - "Generates and persists the given number of AllocationTokens, printing each token to stdout." -) + separators = " =", + commandDescription = + "Generates and persists the given number of AllocationTokens, " + + "printing each token to stdout.") @NonFinalForTesting class GenerateAllocationTokensCommand implements CommandWithRemoteApi { diff --git a/java/google/registry/tools/UniformRapidSuspensionCommand.java b/java/google/registry/tools/UniformRapidSuspensionCommand.java index 9c22488a1..56d436378 100644 --- a/java/google/registry/tools/UniformRapidSuspensionCommand.java +++ b/java/google/registry/tools/UniformRapidSuspensionCommand.java @@ -83,8 +83,9 @@ final class UniformRapidSuspensionCommand extends MutatingEppToolCommand { @Parameter( names = {"-p", "--locks_to_preserve"}, - description = "Comma-delimited set of locks to preserve (only valid with --undo). " - + "Valid locks: serverDeleteProhibited, serverTransferProhibited, serverUpdateProhibited") + description = + "Comma-delimited set of locks to preserve (only valid with --undo). Valid " + + "locks: serverDeleteProhibited, serverTransferProhibited, serverUpdateProhibited") private List locksToPreserve = new ArrayList<>(); @Parameter(