Repository navigation
Fix Console bulk domain suspend and history #3278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,10 +102,12 @@ protected void postHandler(User user) { | |
|
|
||
| checkPermission(user, registrarId, actionType.getNecessaryPermission()); | ||
|
|
||
| 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))); | ||
| handleHistoryAdditions(result, actionType); | ||
| // Front end should parse situations where only some commands worked | ||
| consoleApiParams.response().setPayload(consoleApiParams.gson().toJson(result)); | ||
|
|
@@ -125,19 +127,24 @@ private void handleHistoryAdditions( | |
| e -> | ||
| finishAndPersistConsoleUpdateHistory( | ||
| new ConsoleUpdateHistory.Builder() | ||
| .setDescription(e.getKey()) | ||
| .setDescription( | ||
| String.format( | ||
| "%s%s%s", | ||
| registrarId, | ||
| ConsoleUpdateHistory.DESCRIPTION_SEPARATOR, | ||
| e.getKey())) | ||
| .setType(actionType.getConsoleUpdateHistoryType())))); | ||
| } | ||
|
|
||
| private ConsoleEppOutput executeEpp(String xml, User user) { | ||
| private ConsoleEppOutput executeEpp(String xml, boolean isSuperuser) { | ||
| return ConsoleEppOutput.fromEppOutput( | ||
| eppController.handleEppCommand( | ||
| new StatelessRequestSessionMetadata( | ||
| registrarId, ProtocolDefinition.getVisibleServiceExtensionUris()), | ||
| new PasswordOnlyTransportCredentials(), | ||
| EppRequestSource.CONSOLE, | ||
| false, | ||
| user.getUserRoles().isAdmin(), | ||
| isSuperuser, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verify if intentional — registrar EPP In
|
||
| xml.getBytes(UTF_8))); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must land after (or rebased onto) #3287:
Setting
runAsSuperuser() = trueforSUSPENDandUNSUSPENDbypassesDomainUpdateFlow'sverifyResourceOwnershipandcheckAllowedAccessToTldchecks for all users holdingSUSPEND_DOMAIN(including non-adminFTEandSUPPORT_LEADusers, who previously ran withisSuperuser = false).Without #3287's registrar ownership check in place first:
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/UNSUSPENDrejection for non-adminFTE/SUPPORT_LEADusers.