mirror of
https://github.com/google/nomulus.git
synced 2025-05-16 01:17:14 +02:00
Rename LrpToken to LrpTokenEntity
This is to better distinguish between an LRP "token" (the string passed along in EPP) and the datastore entity that contains the token and all metadata. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=135943480
This commit is contained in:
parent
1a9f91ed9e
commit
dd9137fbd1
14 changed files with 104 additions and 97 deletions
|
@ -57,7 +57,7 @@ import google.registry.model.domain.DomainBase;
|
|||
import google.registry.model.domain.DomainBase.Builder;
|
||||
import google.registry.model.domain.DomainCommand.Create;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.LrpToken;
|
||||
import google.registry.model.domain.LrpTokenEntity;
|
||||
import google.registry.model.domain.fee.FeeTransformCommandExtension;
|
||||
import google.registry.model.domain.flags.FlagsCreateCommandExtension;
|
||||
import google.registry.model.domain.launch.LaunchCreateExtension;
|
||||
|
@ -94,7 +94,7 @@ public abstract class BaseDomainCreateFlow<R extends DomainBase, B extends Build
|
|||
protected SignedMark signedMark;
|
||||
protected boolean isAnchorTenantViaReservation;
|
||||
protected TldState tldState;
|
||||
protected Optional<LrpToken> lrpToken;
|
||||
protected Optional<LrpTokenEntity> lrpToken;
|
||||
|
||||
protected Optional<RegistryExtraFlowLogic> extraFlowLogic;
|
||||
|
||||
|
@ -206,7 +206,7 @@ public abstract class BaseDomainCreateFlow<R extends DomainBase, B extends Build
|
|||
&& !isAnchorTenantViaReservation;
|
||||
lrpToken = isLrpApplication
|
||||
? TldSpecificLogicProxy.getMatchingLrpToken(command, tld)
|
||||
: Optional.<LrpToken>absent();
|
||||
: Optional.<LrpTokenEntity>absent();
|
||||
// Superusers can create reserved domains, force creations on domains that require a claims
|
||||
// notice without specifying a claims key, and override blocks on registering premium domains.
|
||||
if (!isSuperuser) {
|
||||
|
|
|
@ -29,7 +29,7 @@ import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
|||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainCommand.Create;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.LrpToken;
|
||||
import google.registry.model.domain.LrpTokenEntity;
|
||||
import google.registry.model.domain.fee.BaseFee;
|
||||
import google.registry.model.domain.fee.BaseFee.FeeType;
|
||||
import google.registry.model.domain.fee.Credit;
|
||||
|
@ -266,18 +266,18 @@ public final class TldSpecificLogicProxy {
|
|||
}
|
||||
|
||||
/**
|
||||
* Checks whether a {@link Create} command has a valid {@link LrpToken} for a particular TLD, and
|
||||
* return that token (wrapped in an {@link Optional}) if one exists.
|
||||
* Checks whether a {@link Create} command has a valid {@link LrpTokenEntity} for a particular
|
||||
* TLD, and return that token (wrapped in an {@link Optional}) if one exists.
|
||||
*
|
||||
* <p>This method has no knowledge of whether or not an auth code (interpreted here as an LRP
|
||||
* token) has already been checked against the reserved list for QLP (anchor tenant), as auth
|
||||
* codes are used for both types of registrations.
|
||||
*/
|
||||
public static Optional<LrpToken> getMatchingLrpToken(Create createCommand, String tld) {
|
||||
public static Optional<LrpTokenEntity> getMatchingLrpToken(Create createCommand, String tld) {
|
||||
// Note that until the actual per-TLD logic is built out, what's being done here is a basic
|
||||
// domain-name-to-assignee match.
|
||||
String lrpToken = createCommand.getAuthInfo().getPw().getValue();
|
||||
LrpToken token = ofy().load().key(Key.create(LrpToken.class, lrpToken)).now();
|
||||
LrpTokenEntity token = ofy().load().key(Key.create(LrpTokenEntity.class, lrpToken)).now();
|
||||
if (token != null) {
|
||||
if (token.getAssignee().equalsIgnoreCase(createCommand.getFullyQualifiedDomainName())
|
||||
&& token.getRedemptionHistoryEntry() == null
|
||||
|
@ -285,6 +285,6 @@ public final class TldSpecificLogicProxy {
|
|||
return Optional.of(token);
|
||||
}
|
||||
}
|
||||
return Optional.<LrpToken>absent();
|
||||
return Optional.<LrpTokenEntity>absent();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue