Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion apps/files_sharing/src/components/SharingEntryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
:value.sync="share.newPassword"
:disabled="saving"
:required="config.enableLinkPasswordByDefault || config.enforcePasswordForPublicLink"
:minlength="isPasswordPolicyEnabled && config.passwordPolicy.minLength"
:minlength="minPasswordLength"
autocomplete="new-password"
@submit="onNewLinkShare(true)">
<template #icon>
Expand Down Expand Up @@ -341,6 +341,16 @@ export default {
},

computed: {
minPasswordLength() {
if (this.isPasswordPolicyEnabled) {
if (this.config.passwordPolicy.policies?.sharing?.minLength) {
return this.config.passwordPolicy.policies.sharing.minLength
}
return this.config.passwordPolicy.minLength
}
return 0
},

/**
* Link share label
*
Expand Down
12 changes: 11 additions & 1 deletion apps/files_sharing/src/services/ConfigService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,24 @@
import { getCapabilities } from '@nextcloud/capabilities'
import { loadState } from '@nextcloud/initial-state'

type PasswordPolicyCapabilities = {
type PasswordPolicySettings = {
enforceNonCommonPassword: boolean
enforceNumericCharacters: boolean
enforceSpecialCharacters: boolean
enforceUpperLowerCase: boolean
minLength: number
}

type PasswordPolicyCapabilities = PasswordPolicySettings & {
api?: {
generate: string
validate: string
}
policies?: {
sharing: PasswordPolicySettings
}
}

type FileSharingCapabilities = {
api_enabled: boolean,
public: {
Expand Down
4 changes: 3 additions & 1 deletion apps/files_sharing/src/utils/GeneratePassword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export default async function(verbose = false): Promise<string> {
// 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)
const request = await axios.get(config.passwordPolicy.api.generate, {
params: { context: 'sharing' },
})
if (request.data.ocs.data.password) {
if (verbose) {
showSuccess(t('files_sharing', 'Password created successfully'))
Expand Down
2 changes: 0 additions & 2 deletions dist/5190-5190.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/5190-5190.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/5190-5190.js.map.license

This file was deleted.

4 changes: 2 additions & 2 deletions dist/5819-5819.js

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions dist/5819-5819.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ SPDX-License-Identifier: MIT
SPDX-License-Identifier: ISC
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-License-Identifier: BSD-3-Clause
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: (MPL-2.0 OR Apache-2.0)
SPDX-FileCopyrightText: webfansplz
SPDX-FileCopyrightText: string_decoder developers
SPDX-FileCopyrightText: readable-stream developers
SPDX-FileCopyrightText: perfect-debounce developers
SPDX-FileCopyrightText: p-queue developers
SPDX-FileCopyrightText: inherits developers
SPDX-FileCopyrightText: hookable developers
SPDX-FileCopyrightText: escape-html developers
SPDX-FileCopyrightText: debounce developers
Expand All @@ -15,15 +19,22 @@ SPDX-FileCopyrightText: Varun A P
SPDX-FileCopyrightText: Tobias Koppers @sokra
SPDX-FileCopyrightText: Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)
SPDX-FileCopyrightText: T. Jameson Little <t.jameson.little@gmail.com>
SPDX-FileCopyrightText: Sindre Sorhus
SPDX-FileCopyrightText: Roman Shtylman <shtylman@gmail.com>
SPDX-FileCopyrightText: Rob Cresswell <robcresswell@pm.me>
SPDX-FileCopyrightText: Perry Mitchell <perry@perrymitchell.net>
SPDX-FileCopyrightText: Paul Vorbach <paul@vorba.ch> (http://paul.vorba.ch)
SPDX-FileCopyrightText: Paul Vorbach <paul@vorb.de> (http://vorb.de)
SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
SPDX-FileCopyrightText: Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)
SPDX-FileCopyrightText: Matt Zabriskie
SPDX-FileCopyrightText: Jonas Schade <derzade@gmail.com>
SPDX-FileCopyrightText: Jeff Sagal <sagalbot@gmail.com>
SPDX-FileCopyrightText: James Halliday
SPDX-FileCopyrightText: Jacob Clevenger<https://github.com/wheatjs>
SPDX-FileCopyrightText: Iskren Ivov Chernev <iskren.chernev@gmail.com> (https://github.com/ichernev)
SPDX-FileCopyrightText: Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)
SPDX-FileCopyrightText: Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)
SPDX-FileCopyrightText: Guillaume Chau <guillaume.b.chau@gmail.com>
SPDX-FileCopyrightText: GitHub Inc.
SPDX-FileCopyrightText: Feross Aboukhadijeh
Expand All @@ -34,19 +45,35 @@ SPDX-FileCopyrightText: Eduardo San Martin Morote
SPDX-FileCopyrightText: Dr.-Ing. Mario Heiderich, Cure53 <mario@cure53.de> (https://cure53.de/)
SPDX-FileCopyrightText: David Clark
SPDX-FileCopyrightText: Christoph Wurst
SPDX-FileCopyrightText: Chen Fengyuan
SPDX-FileCopyrightText: Borewit
SPDX-FileCopyrightText: Austin Andrews
SPDX-FileCopyrightText: Arnout Kazemier
SPDX-FileCopyrightText: Anthony Fu <https://github.com/antfu>
SPDX-FileCopyrightText: Anthony Fu <anthonyfu117@hotmail.com>
SPDX-FileCopyrightText: Alkemics
SPDX-FileCopyrightText: @nextcloud/dialogs developers


This file is generated from multiple sources. Included packages:
- @chenfengyuan/vue-qrcode
- version: 1.0.2
- license: MIT
- @file-type/xml
- version: 0.4.3
- license: MIT
- @floating-ui/core
- version: 1.8.0
- license: MIT
- @floating-ui/dom
- version: 1.8.0
- license: MIT
- @floating-ui/utils
- version: 0.2.12
- license: MIT
- @mdi/js
- version: 7.4.47
- license: Apache-2.0
- @nextcloud/auth
- version: 2.6.0
- license: GPL-3.0-or-later
Expand Down Expand Up @@ -128,12 +155,18 @@ This file is generated from multiple sources. Included packages:
- @nextcloud/logger
- version: 3.0.3
- license: GPL-3.0-or-later
- @nextcloud/moment
- version: 1.3.5
- license: GPL-3.0-or-later
- @nextcloud/router
- version: 3.1.0
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.4.0
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.26.0
- license: MIT
- @nextcloud/initial-state
- version: 2.2.0
- license: GPL-3.0-or-later
Expand Down Expand Up @@ -182,6 +215,9 @@ This file is generated from multiple sources. Included packages:
- escape-html
- version: 1.0.3
- license: MIT
- events
- version: 3.3.0
- license: MIT
- @floating-ui/core
- version: 0.3.1
- license: MIT
Expand All @@ -197,24 +233,48 @@ This file is generated from multiple sources. Included packages:
- ieee754
- version: 1.2.1
- license: BSD-3-Clause
- inherits
- version: 2.0.4
- license: ISC
- is-buffer
- version: 1.1.6
- license: MIT
- is-svg
- version: 6.1.0
- license: MIT
- md5
- version: 2.3.0
- license: BSD-3-Clause
- moment
- version: 2.30.1
- license: MIT
- buffer
- version: 6.0.3
- license: MIT
- nostics
- version: 1.2.0
- license: MIT
- eventemitter3
- version: 5.0.4
- license: MIT
- p-queue
- version: 8.1.1
- license: MIT
- process
- version: 0.11.10
- license: MIT
- safe-buffer
- version: 5.2.1
- license: MIT
- sax
- version: 1.4.1
- license: ISC
- readable-stream
- version: 3.6.2
- license: MIT
- stream-browserify
- version: 3.0.0
- license: MIT
- string_decoder
- version: 1.3.0
- license: MIT
Expand Down Expand Up @@ -242,6 +302,9 @@ This file is generated from multiple sources. Included packages:
- unist-util-visit-parents
- version: 6.0.2
- license: MIT
- util-deprecate
- version: 1.0.2
- license: MIT
- vue-loader
- version: 15.11.1
- license: MIT
Expand Down
2 changes: 1 addition & 1 deletion dist/5819-5819.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/8200-8200.js

Large diffs are not rendered by default.

63 changes: 0 additions & 63 deletions dist/5190-5190.js.license → dist/8200-8200.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ SPDX-License-Identifier: MIT
SPDX-License-Identifier: ISC
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-License-Identifier: BSD-3-Clause
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: (MPL-2.0 OR Apache-2.0)
SPDX-FileCopyrightText: webfansplz
SPDX-FileCopyrightText: string_decoder developers
SPDX-FileCopyrightText: readable-stream developers
SPDX-FileCopyrightText: perfect-debounce developers
SPDX-FileCopyrightText: p-queue developers
SPDX-FileCopyrightText: inherits developers
SPDX-FileCopyrightText: hookable developers
SPDX-FileCopyrightText: escape-html developers
SPDX-FileCopyrightText: debounce developers
Expand All @@ -19,22 +15,15 @@ SPDX-FileCopyrightText: Varun A P
SPDX-FileCopyrightText: Tobias Koppers @sokra
SPDX-FileCopyrightText: Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)
SPDX-FileCopyrightText: T. Jameson Little <t.jameson.little@gmail.com>
SPDX-FileCopyrightText: Sindre Sorhus
SPDX-FileCopyrightText: Roman Shtylman <shtylman@gmail.com>
SPDX-FileCopyrightText: Rob Cresswell <robcresswell@pm.me>
SPDX-FileCopyrightText: Perry Mitchell <perry@perrymitchell.net>
SPDX-FileCopyrightText: Paul Vorbach <paul@vorba.ch> (http://paul.vorba.ch)
SPDX-FileCopyrightText: Paul Vorbach <paul@vorb.de> (http://vorb.de)
SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
SPDX-FileCopyrightText: Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)
SPDX-FileCopyrightText: Matt Zabriskie
SPDX-FileCopyrightText: Jonas Schade <derzade@gmail.com>
SPDX-FileCopyrightText: Jeff Sagal <sagalbot@gmail.com>
SPDX-FileCopyrightText: James Halliday
SPDX-FileCopyrightText: Jacob Clevenger<https://github.com/wheatjs>
SPDX-FileCopyrightText: Iskren Ivov Chernev <iskren.chernev@gmail.com> (https://github.com/ichernev)
SPDX-FileCopyrightText: Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)
SPDX-FileCopyrightText: Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)
SPDX-FileCopyrightText: Guillaume Chau <guillaume.b.chau@gmail.com>
SPDX-FileCopyrightText: GitHub Inc.
SPDX-FileCopyrightText: Feross Aboukhadijeh
Expand All @@ -45,35 +34,19 @@ SPDX-FileCopyrightText: Eduardo San Martin Morote
SPDX-FileCopyrightText: Dr.-Ing. Mario Heiderich, Cure53 <mario@cure53.de> (https://cure53.de/)
SPDX-FileCopyrightText: David Clark
SPDX-FileCopyrightText: Christoph Wurst
SPDX-FileCopyrightText: Chen Fengyuan
SPDX-FileCopyrightText: Borewit
SPDX-FileCopyrightText: Austin Andrews
SPDX-FileCopyrightText: Arnout Kazemier
SPDX-FileCopyrightText: Anthony Fu <https://github.com/antfu>
SPDX-FileCopyrightText: Anthony Fu <anthonyfu117@hotmail.com>
SPDX-FileCopyrightText: Alkemics
SPDX-FileCopyrightText: @nextcloud/dialogs developers


This file is generated from multiple sources. Included packages:
- @chenfengyuan/vue-qrcode
- version: 1.0.2
- license: MIT
- @file-type/xml
- version: 0.4.3
- license: MIT
- @floating-ui/core
- version: 1.8.0
- license: MIT
- @floating-ui/dom
- version: 1.8.0
- license: MIT
- @floating-ui/utils
- version: 0.2.12
- license: MIT
- @mdi/js
- version: 7.4.47
- license: Apache-2.0
- @nextcloud/auth
- version: 2.6.0
- license: GPL-3.0-or-later
Expand Down Expand Up @@ -155,18 +128,12 @@ This file is generated from multiple sources. Included packages:
- @nextcloud/logger
- version: 3.0.3
- license: GPL-3.0-or-later
- @nextcloud/moment
- version: 1.3.5
- license: GPL-3.0-or-later
- @nextcloud/router
- version: 3.1.0
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.4.0
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.26.0
- license: MIT
- @nextcloud/initial-state
- version: 2.2.0
- license: GPL-3.0-or-later
Expand Down Expand Up @@ -215,9 +182,6 @@ This file is generated from multiple sources. Included packages:
- escape-html
- version: 1.0.3
- license: MIT
- events
- version: 3.3.0
- license: MIT
- @floating-ui/core
- version: 0.3.1
- license: MIT
Expand All @@ -233,48 +197,24 @@ This file is generated from multiple sources. Included packages:
- ieee754
- version: 1.2.1
- license: BSD-3-Clause
- inherits
- version: 2.0.4
- license: ISC
- is-buffer
- version: 1.1.6
- license: MIT
- is-svg
- version: 6.1.0
- license: MIT
- md5
- version: 2.3.0
- license: BSD-3-Clause
- moment
- version: 2.30.1
- license: MIT
- buffer
- version: 6.0.3
- license: MIT
- nostics
- version: 1.2.0
- license: MIT
- eventemitter3
- version: 5.0.4
- license: MIT
- p-queue
- version: 8.1.1
- license: MIT
- process
- version: 0.11.10
- license: MIT
- safe-buffer
- version: 5.2.1
- license: MIT
- sax
- version: 1.4.1
- license: ISC
- readable-stream
- version: 3.6.2
- license: MIT
- stream-browserify
- version: 3.0.0
- license: MIT
- string_decoder
- version: 1.3.0
- license: MIT
Expand Down Expand Up @@ -302,9 +242,6 @@ This file is generated from multiple sources. Included packages:
- unist-util-visit-parents
- version: 6.0.2
- license: MIT
- util-deprecate
- version: 1.0.2
- license: MIT
- vue-loader
- version: 15.11.1
- license: MIT
Expand Down
1 change: 1 addition & 0 deletions dist/8200-8200.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/8200-8200.js.map.license
Loading
Loading