Decouple superuser from SessionMetadata

Superuser should only be settable via the tool (see []
which is merged in here but not diffbased, and which removes
the implicit superuser for CharlestonRoad). It is a property
of the request, not of the session (there are no sessions in the tool).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125204707
This commit is contained in:
cgoldfeder 2016-06-17 14:48:46 -07:00 committed by Ben McIlwain
parent e359ab5f52
commit fd6c4888db
44 changed files with 80 additions and 136 deletions

View file

@ -39,7 +39,6 @@ import google.registry.model.eppoutput.Result.Code;
import google.registry.model.registrar.Registrar;
import google.registry.util.FormattingLogger;
import java.util.Objects;
import java.util.Set;
/**
@ -66,9 +65,6 @@ public class LoginFlow extends Flow {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
/** This is the IANA ID used for the internal account of the registry. */
private static final long INTERNAL_IANA_REGISTRAR_ID = 9999L;
/** Maximum number of failed login attempts allowed per connection. */
private static final int MAX_FAILED_LOGIN_ATTEMPTS_PER_CONNECTION = 3;
@ -134,8 +130,6 @@ public class LoginFlow extends Flow {
// We are in!
sessionMetadata.resetFailedLoginAttempts();
sessionMetadata.setClientId(login.getClientId());
sessionMetadata.setSuperuser(
Objects.equals(INTERNAL_IANA_REGISTRAR_ID, registrar.getIanaIdentifier()));
sessionMetadata.setServiceExtensionUris(serviceExtensionUrisBuilder.build());
return createOutput(Code.Success);
}