-
Notifications
You must be signed in to change notification settings - Fork 481
release(26.04.11-03): cherry-pick #35553 security fix onto 26.04.11-02 #35634
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
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ac83b2f
fix(publisher): parameterize getPublishAuditStatuses bundle-id query
mbiuki 8e0a64a
test(publisher): regression tests for getPublishAuditStatuses paramet…
mbiuki 9700936
Apply suggestions from code review
mbiuki 0f3a942
fix: remove duplicate placeholders block from accidental suggestion a…
mbiuki 3369c2b
fix(rest): require backend user + publishing-queue portlet on AuditPu…
mbiuki 37700cf
test: use dotCMS-specific SecurityException in AuditPublishingResourc…
mbiuki 408bcc6
add AuditPublishingResourceTest to the MainSuite2a
dario-daza 293c081
use PP authorization in AuditPublishingResource instead of WebResourc…
dario-daza c1b78bd
fix(publisher): add PP auth header to audit poll and prevent 500 on m…
dario-daza 0954753
fix(cicd): backport workflow_dispatch trigger to release-26.04.11-03
sfreudenthaler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
dotcms-integration/src/test/java/com/dotcms/rest/AuditPublishingResourceTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package com.dotcms.rest; | ||
|
|
||
| import com.dotcms.IntegrationTestBase; | ||
| import com.dotcms.util.IntegrationTestInitService; | ||
| import org.junit.BeforeClass; | ||
| import org.junit.Test; | ||
|
|
||
| import javax.servlet.http.HttpServletRequest; | ||
| import javax.ws.rs.core.Response; | ||
| import java.util.Collections; | ||
|
|
||
| import static org.junit.Assert.assertEquals; | ||
| import static org.mockito.Mockito.mock; | ||
|
|
||
| /** | ||
| * Verifies that {@link AuditPublishingResource} enforces push-publish token | ||
| * authentication on its endpoints. Both methods were previously reachable | ||
| * anonymously; they now require a valid PP auth token. | ||
| */ | ||
| public class AuditPublishingResourceTest extends IntegrationTestBase { | ||
|
|
||
| @BeforeClass | ||
| public static void prepare() throws Exception { | ||
| IntegrationTestInitService.getInstance().init(); | ||
| } | ||
|
|
||
| /** | ||
| * Method to test: {@link AuditPublishingResource#get(String, HttpServletRequest)} | ||
| * When: called with a request that carries no push-publish auth token | ||
| * Should: return 401 Unauthorized. | ||
| */ | ||
| @Test | ||
| public void test_get_rejectsAnonymousRequest() { | ||
| final HttpServletRequest request = mock(HttpServletRequest.class); | ||
| final Response response = new AuditPublishingResource().get("any-bundle-id", request); | ||
| assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), response.getStatus()); | ||
| } | ||
|
|
||
| /** | ||
| * Method to test: {@link AuditPublishingResource#getAll(java.util.List, HttpServletRequest)} | ||
| * When: called with a request that carries no push-publish auth token | ||
| * Should: return 401 Unauthorized. | ||
| */ | ||
| @Test | ||
| public void test_getAll_rejectsAnonymousRequest() { | ||
| final HttpServletRequest request = mock(HttpServletRequest.class); | ||
| final Response response = new AuditPublishingResource() | ||
| .getAll(Collections.singletonList("any-bundle-id"), request); | ||
| assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), response.getStatus()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.