Repository navigation
Conversation
|
Do note that there are reasons to perform a superuser delete (that bypasses some checks and even can delete a domain instantly, bypassing the normal deletion lifecycle). However, this probably doesn't need to be doable through the bulk domain action. |
Fix two bugs in ConsoleBulkDomainAction: - Add runAsSuperuser() to ConsoleDomainActionType (returning true for SUSPEND and UNSUSPEND and false for DELETE) and pass it to EppController instead of user.getUserRoles().isAdmin(). Previously, DomainUpdateFlow rejected the server-only suspension statuses for non-admin FTE and SUPPORT_LEAD users who hold SUSPEND_DOMAIN. Superuser status is now driven solely by the action type, so DELETE never runs as superuser through the bulk domain action, even for admins. Superuser deletes, which bypass server statuses and can delete domains immediately, remain available through the nomulus CLI. - Prefix ConsoleUpdateHistory descriptions with '<registrarId>|' using ConsoleUpdateHistory.DESCRIPTION_SEPARATOR so bulk domain actions are returned by ConsoleHistoryDataAction's registrar history query and parsed properly in the Console history UI. - Add unit tests in ConsoleBulkDomainActionTest covering non-admin FTE and SUPPORT_LEAD suspend/unsuspend flows, permission enforcement, non-superuser DELETE for both admin and non-admin users, and ConsoleHistoryDataAction queries. BUG= http://b/586480958
1c308aa to
e99294b
Compare
| boolean isSuperuser = actionType.runAsSuperuser(); | ||
| ImmutableMap<String, ConsoleEppOutput> result = | ||
| domainList.domainList.stream() | ||
| .collect( | ||
| toImmutableMap(d -> d, d -> executeEpp(actionType.getXmlContentsToRun(d), user))); | ||
| toImmutableMap( | ||
| d -> d, d -> executeEpp(actionType.getXmlContentsToRun(d), isSuperuser))); |
There was a problem hiding this comment.
Must land after (or rebased onto) #3287:
Setting runAsSuperuser() = true for SUSPEND and UNSUSPEND bypasses DomainUpdateFlow's verifyResourceOwnership and checkAllowedAccessToTld checks for all users holding SUSPEND_DOMAIN (including non-admin FTE and SUPPORT_LEAD users, who previously ran with isSuperuser = false).
Without #3287's registrar ownership check in place first:
- Non-admin
FTEandSUPPORT_LEADrequests tagged withregistrarId = RegistrarBcan suspend/unsuspend domains sponsored byRegistrarA. handleHistoryAdditionsbelow then logsRegistrarB|<domain>inConsoleUpdateHistory, misattributing the audit entry toRegistrarBand hiding the action fromRegistrarA's Console Activity History.
When rebasing onto #3287, also add a test verifying cross-registrar SUSPEND/UNSUSPEND rejection for non-admin FTE/SUPPORT_LEAD users.
| EppRequestSource.CONSOLE, | ||
| false, | ||
| user.getUserRoles().isAdmin(), | ||
| isSuperuser, |
There was a problem hiding this comment.
Verify if intentional — registrar EPP PollMessage suppressed & DomainHistory attributed to the registrar itself:
executeEpp runs EppController with StatelessRequestSessionMetadata(registrarId, ...) (the sponsoring registrar's ID, rather than registryAdminClientId) and isSuperuser = true.
In DomainUpdateFlow.createPollMessageForServerStatusUpdates, if (registrarId.equals(existingDomain.getPersistedCurrentSponsorRegistrarId())) returns Optional.empty(). As a result:
- No EPP
PollMessage.OneTime("The registry administrator has added/removed the status(es) ...") is enqueued for the sponsoring registrar when a domain is suspended/unsuspended from the Console (unlike CLI suspensions viaUpdateServerLocksCommandusing the admin client ID). DomainHistory.registrarIdandDomain.lastEppUpdateRegistrarIdrecord the sponsoring registrar as having suspended its own domain, even though<metadata:requestedByRegistrar>false</metadata:requestedByRegistrar>is set.
Fix two bugs in ConsoleBulkDomainAction:
SUSPEND and UNSUSPEND and false for DELETE) and pass it to
EppController instead of user.getUserRoles().isAdmin(). Previously,
DomainUpdateFlow rejected the server-only suspension statuses for
non-admin FTE and SUPPORT_LEAD users who hold SUSPEND_DOMAIN.
Superuser status is now driven solely by the action type, so DELETE
never runs as superuser through the bulk domain action, even for
admins. Superuser deletes, which bypass server statuses and can
delete domains immediately, remain available through the nomulus CLI.
<registrarId>|usingConsoleUpdateHistory.DESCRIPTION_SEPARATOR so bulk domain actions are
returned by ConsoleHistoryDataAction's registrar history query and
parsed properly in the Console history UI.
and SUPPORT_LEAD suspend/unsuspend flows, permission enforcement,
non-superuser DELETE for both admin and non-admin users, and
ConsoleHistoryDataAction queries.
BUG= http://b/586480958
This change is