mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 16:37:13 +02:00
Remove LoggedInFlow
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=137444791
This commit is contained in:
parent
8b068250d6
commit
b84d7f1fb5
50 changed files with 763 additions and 429 deletions
|
@ -14,6 +14,8 @@
|
|||
|
||||
package google.registry.flows.session;
|
||||
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.ExtensionManager;
|
||||
import google.registry.flows.Flow;
|
||||
import google.registry.model.eppoutput.EppOutput;
|
||||
import google.registry.model.eppoutput.Greeting;
|
||||
|
@ -22,10 +24,12 @@ import javax.inject.Inject;
|
|||
/** A flow for an Epp "hello". */
|
||||
public class HelloFlow extends Flow {
|
||||
|
||||
@Inject ExtensionManager extensionManager;
|
||||
@Inject HelloFlow() {}
|
||||
|
||||
@Override
|
||||
public EppOutput run() {
|
||||
public EppOutput run() throws EppException {
|
||||
extensionManager.validate(); // There are no legal extensions for this flow.
|
||||
return EppOutput.create(Greeting.create(now));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import google.registry.flows.EppException.ParameterValuePolicyErrorException;
|
|||
import google.registry.flows.EppException.UnimplementedExtensionException;
|
||||
import google.registry.flows.EppException.UnimplementedObjectServiceException;
|
||||
import google.registry.flows.EppException.UnimplementedOptionException;
|
||||
import google.registry.flows.ExtensionManager;
|
||||
import google.registry.flows.Flow;
|
||||
import google.registry.flows.FlowModule.ClientId;
|
||||
import google.registry.model.eppcommon.ProtocolDefinition;
|
||||
|
@ -68,6 +69,7 @@ public class LoginFlow extends Flow {
|
|||
/** Maximum number of failed login attempts allowed per connection. */
|
||||
private static final int MAX_FAILED_LOGIN_ATTEMPTS_PER_CONNECTION = 3;
|
||||
|
||||
@Inject ExtensionManager extensionManager;
|
||||
@Inject @ClientId String clientId;
|
||||
@Inject LoginFlow() {}
|
||||
|
||||
|
@ -84,6 +86,7 @@ public class LoginFlow extends Flow {
|
|||
|
||||
/** Run the flow without bothering to log errors. The {@link #run} method will do that for us. */
|
||||
public final EppOutput runWithoutLogging() throws EppException {
|
||||
extensionManager.validate(); // There are no legal extensions for this flow.
|
||||
Login login = (Login) eppInput.getCommandWrapper().getCommand();
|
||||
if (!clientId.isEmpty()) {
|
||||
throw new AlreadyLoggedInException();
|
||||
|
|
|
@ -14,24 +14,31 @@
|
|||
|
||||
package google.registry.flows.session;
|
||||
|
||||
import static google.registry.flows.FlowUtils.validateClientIsLoggedIn;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS_AND_CLOSE;
|
||||
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.LoggedInFlow;
|
||||
import google.registry.flows.ExtensionManager;
|
||||
import google.registry.flows.Flow;
|
||||
import google.registry.flows.FlowModule.ClientId;
|
||||
import google.registry.model.eppoutput.EppOutput;
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow for logout.
|
||||
*
|
||||
* @error {@link google.registry.flows.LoggedInFlow.NotLoggedInException}
|
||||
* @error {@link google.registry.flows.FlowUtils.NotLoggedInException}
|
||||
*/
|
||||
public class LogoutFlow extends LoggedInFlow {
|
||||
public class LogoutFlow extends Flow {
|
||||
|
||||
@Inject ExtensionManager extensionManager;
|
||||
@Inject @ClientId String clientId;
|
||||
@Inject LogoutFlow() {}
|
||||
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
extensionManager.validate(); // There are no legal extensions for this flow.
|
||||
validateClientIsLoggedIn(clientId);
|
||||
sessionMetadata.invalidate();
|
||||
return createOutput(SUCCESS_AND_CLOSE);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue