-
Notifications
You must be signed in to change notification settings - Fork 142
feat: Add option to set secure view for public talk shares #4772
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9bd2020
feat: Add option to set secure view for public talk shares
juliusknorr c13e658
chore: Move settings checkbox and input to nextcloud-vue components
juliusknorr 0076f56
feat: Add storage wrappert to block download on secure view
juliusknorr 37b3729
test(cypress-talk): Add e2e test talk shares opening viewer and for s…
juliusknorr 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -180,4 +180,4 @@ describe('Nextcloud integration', function() { | |
| }) | ||
| }) | ||
| }) | ||
| }) | ||
| }) | ||
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,110 @@ | ||
| /** | ||
| * SPDX-FileCopyrightText: 2023 Julius Härtl <jus@bitgrid.net> | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| describe('Talk integraiton integration', function() { | ||
| let randUser | ||
|
|
||
| const resetConfig = () => { | ||
| cy.nextcloudTestingAppConfigSet('files', 'watermark_enabled', 'no') | ||
| cy.nextcloudTestingAppConfigSet('files', 'watermark_text', '{userId}') | ||
| cy.nextcloudTestingAppConfigSet('files', 'watermark_shareTalkPublic', 'no') | ||
| cy.nextcloudTestingAppConfigSet('richdocuments', 'uiDefaults-UIMode', 'notebookbar') | ||
| } | ||
|
|
||
| before(function() { | ||
| resetConfig() | ||
| cy.createRandomUser().then(user => { | ||
| randUser = user | ||
| cy.login(user) | ||
| cy.uploadFile(user, 'document.odt', 'application/vnd.oasis.opendocument.text', '/document.odt') | ||
| }) | ||
| }) | ||
|
|
||
| afterEach(() => { | ||
| resetConfig() | ||
| }) | ||
|
|
||
| const filename = 'document.odt' | ||
|
|
||
| beforeEach(function() { | ||
| cy.login(randUser) | ||
| }) | ||
|
|
||
| it('Can share a file to a talk room and open it', function() { | ||
| cy.createTalkRoom(randUser, { | ||
| roomName: 'Test room', | ||
| }).then(room => { | ||
| cy.log(`Created talk room "${room.name}"`, room) | ||
| cy.shareFileToTalkRoom(randUser, filename, room.token) | ||
| cy.visit(`/call/${room.token}`) | ||
| cy.get('.file-preview') | ||
| .should('be.visible') | ||
| .should('contain.text', filename) | ||
| .click() | ||
|
|
||
| cy.waitForViewer() | ||
| cy.waitForCollabora() | ||
| }) | ||
| }) | ||
|
|
||
| it('See that the file is shared without download', function() { | ||
| cy.nextcloudTestingAppConfigSet('files', 'watermark_enabled', 'yes') | ||
| cy.nextcloudTestingAppConfigSet('files', 'watermark_shareTalkPublic', 'yes') | ||
| cy.nextcloudTestingAppConfigSet('files', 'watermark_text', 'TestingWatermark') | ||
|
|
||
| cy.createTalkRoom(randUser, { | ||
| roomName: 'Secure room', | ||
| }).then(room => { | ||
| cy.log(`Created talk room "${room.name}"`, room) | ||
| cy.shareFileToTalkRoom(randUser, filename, room.token, { permission: 1 }) | ||
| cy.makeTalkRoomPublic(randUser, room.token) | ||
|
|
||
| cy.logout() | ||
| cy.clearAllLocalStorage() | ||
| cy.visit(`/call/${room.token}`) | ||
| cy.get('.username-form__input input[type="text"]') | ||
| .should('be.visible') | ||
| .type('Test user{enter}') | ||
|
|
||
| // Assert that the download button is hidden in talk | ||
| cy.get('.messages:contains("document.odt")') | ||
| .trigger('mouseover') | ||
|
|
||
| cy.get('.file-preview') | ||
| .closest('.message') | ||
| .find('button[aria-label="Actions"]') | ||
| .should('be.visible') | ||
| .click() | ||
|
|
||
| cy.get('.action:contains("Download")') | ||
| .should('not.exist') | ||
|
|
||
| // Assert the file is still opening | ||
| cy.get('.file-preview') | ||
| .should('be.visible') | ||
| .should('contain.text', filename) | ||
| // We need to get the href to work around how cypress works with windows | ||
| .invoke('attr', 'href') | ||
| .then((href) => { | ||
| cy.visit(href) | ||
|
|
||
| cy.get('[data-cy="guestNameModal"]').should('be.visible') | ||
| cy.inputCollaboraGuestName('A guest') | ||
|
|
||
| cy.waitForCollabora() | ||
|
|
||
| cy.url().then(url => { | ||
| const baseUrl = url.split('?')[0] | ||
| cy.request({ | ||
| url: baseUrl + '/download', | ||
| failOnStatusCode: false, | ||
| }).then((response) => { | ||
| expect(response.status).to.eq(403) | ||
| }) | ||
| }) | ||
| }) | ||
| }) | ||
| }) | ||
| }) |
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
Oops, something went wrong.
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.
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.
We dropped this with #1728 in the past due to performance impact, but this is no longer a problem since the whole Application.php is now only using lazy registration methods