mirror of
https://github.com/google/nomulus
synced 2026-05-28 10:40:44 +00:00
Add an action to check the status of OT&E verification
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=228333195
This commit is contained in:
@@ -361,7 +361,7 @@ public final class OteAccountBuilder {
|
||||
}
|
||||
|
||||
/** Returns the ClientIds of the OT&E, with the TLDs each has access to. */
|
||||
static ImmutableMap<String, String> createClientIdToTldMap(String baseClientId) {
|
||||
public static ImmutableMap<String, String> createClientIdToTldMap(String baseClientId) {
|
||||
checkArgument(
|
||||
REGISTRAR_PATTERN.matcher(baseClientId).matches(),
|
||||
"Invalid registrar name: %s",
|
||||
@@ -374,4 +374,17 @@ public final class OteAccountBuilder {
|
||||
.put(baseClientId + "-5", baseClientId + "-eap")
|
||||
.build();
|
||||
}
|
||||
|
||||
/** Returns the base client ID that correspond to a given OT&E client ID. */
|
||||
public static String getBaseClientId(String oteClientId) {
|
||||
int index = oteClientId.lastIndexOf('-');
|
||||
checkArgument(index > 0, "Invalid OT&E client ID: %s", oteClientId);
|
||||
String baseClientId = oteClientId.substring(0, index);
|
||||
checkArgument(
|
||||
createClientIdToTldMap(baseClientId).containsKey(oteClientId),
|
||||
"ID %s is not one of the OT&E client IDs for base %s",
|
||||
oteClientId,
|
||||
baseClientId);
|
||||
return baseClientId;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user