-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Sharing link & mail parity #24364
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
Sharing link & mail parity #24364
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
100d5d9
Add labels to mail shares
skjnldsv c8e0809
Extract GeneratePassword function to its own file
skjnldsv c47e79f
Handle enforced password for mail shares in the WebUI
skjnldsv 5e519fe
Clear the input after adding a new share
skjnldsv a100186
Sharing link & mail parity
skjnldsv 0f3f6a6
Fix tests
skjnldsv f998769
Remove duplicated query for email shares
danxuliu 1576764
Fix sharebymail tests
skjnldsv 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
|
|
||
| /** | ||
| * @copyright Copyright (c) 2020 John Molakvoæ <[email protected]> | ||
| * | ||
| * @author John Molakvoæ <[email protected]> | ||
| * | ||
| * @license GNU AGPL version 3 or any later version | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Affero General Public License as | ||
| * published by the Free Software Foundation, either version 3 of the | ||
| * License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Affero General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Affero General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| * | ||
| */ | ||
|
|
||
| import axios from '@nextcloud/axios' | ||
| import Config from '../services/ConfigService' | ||
|
|
||
| const config = new Config() | ||
| const passwordSet = 'abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789' | ||
|
|
||
| /** | ||
| * Generate a valid policy password or | ||
| * request a valid password if password_policy | ||
| * is enabled | ||
| * | ||
| * @returns {string} a valid password | ||
| */ | ||
| export default async function() { | ||
| // password policy is enabled, let's request a pass | ||
| if (config.passwordPolicy.api && config.passwordPolicy.api.generate) { | ||
| try { | ||
| const request = await axios.get(config.passwordPolicy.api.generate) | ||
| if (request.data.ocs.data.password) { | ||
| return request.data.ocs.data.password | ||
| } | ||
| } catch (error) { | ||
| console.info('Error generating password from password_policy', error) | ||
| } | ||
| } | ||
|
|
||
| // generate password of 10 length based on passwordSet | ||
| return Array(10).fill(0) | ||
| .reduce((prev, curr) => { | ||
| prev += passwordSet.charAt(Math.floor(Math.random() * passwordSet.length)) | ||
| return prev | ||
| }, '') | ||
| } |
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.
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.