aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-11-16 14:13:56 +0100
committerGitHub <noreply@github.com>2020-11-16 14:13:56 +0100
commit426dc68b456f4ea5c5bfbe9f07053e17924ea31a (patch)
treefc0977d7fe34835f948c08791884f14dbaeeddac /build
parentd0f738fd595abc6449e96b4acc06a74905560091 (diff)
parent28c57004dda25f9d78a9679237d1ec747c1d60b0 (diff)
downloadnextcloud-server-426dc68b456f4ea5c5bfbe9f07053e17924ea31a.tar.gz
nextcloud-server-426dc68b456f4ea5c5bfbe9f07053e17924ea31a.zip
Merge pull request #24069 from nextcloud/fix-default-internal-expiration-date
Fix default internal expiration date
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/AppConfiguration.php13
-rw-r--r--build/integration/features/bootstrap/CapabilitiesContext.php22
-rw-r--r--build/integration/features/bootstrap/FederationContext.php4
-rw-r--r--build/integration/features/bootstrap/ShareesContext.php6
-rw-r--r--build/integration/features/bootstrap/SharingContext.php10
-rw-r--r--build/integration/sharing_features/sharing-v1.feature106
6 files changed, 143 insertions, 18 deletions
diff --git a/build/integration/features/bootstrap/AppConfiguration.php b/build/integration/features/bootstrap/AppConfiguration.php
index b893637ba6c..fe8308fd59b 100644
--- a/build/integration/features/bootstrap/AppConfiguration.php
+++ b/build/integration/features/bootstrap/AppConfiguration.php
@@ -72,6 +72,19 @@ trait AppConfiguration {
}
}
+ /**
+ * @param string $app
+ * @param string $parameter
+ * @param string $value
+ */
+ protected function deleteServerConfig($app, $parameter) {
+ $this->sendingTo('DELETE', "/apps/testing/api/v1/app/{$app}/{$parameter}");
+ $this->theHTTPStatusCodeShouldBe('200');
+ if ($this->apiVersion === 1) {
+ $this->theOCSStatusCodeShouldBe('100');
+ }
+ }
+
protected function setStatusTestingApp($enabled) {
$this->sendingTo(($enabled ? 'post' : 'delete'), '/cloud/apps/testing');
$this->theHTTPStatusCodeShouldBe('200');
diff --git a/build/integration/features/bootstrap/CapabilitiesContext.php b/build/integration/features/bootstrap/CapabilitiesContext.php
index bba85e3c65e..9b3d042d862 100644
--- a/build/integration/features/bootstrap/CapabilitiesContext.php
+++ b/build/integration/features/bootstrap/CapabilitiesContext.php
@@ -61,16 +61,16 @@ class CapabilitiesContext implements Context, SnippetAcceptingContext {
}
protected function resetAppConfigs() {
- $this->modifyServerConfig('core', 'shareapi_enabled', 'yes');
- $this->modifyServerConfig('core', 'shareapi_allow_links', 'yes');
- $this->modifyServerConfig('core', 'shareapi_allow_public_upload', 'yes');
- $this->modifyServerConfig('core', 'shareapi_allow_resharing', 'yes');
- $this->modifyServerConfig('files_sharing', 'outgoing_server2server_share_enabled', 'yes');
- $this->modifyServerConfig('files_sharing', 'incoming_server2server_share_enabled', 'yes');
- $this->modifyServerConfig('core', 'shareapi_enforce_links_password', 'no');
- $this->modifyServerConfig('core', 'shareapi_allow_public_notification', 'no');
- $this->modifyServerConfig('core', 'shareapi_default_expire_date', 'no');
- $this->modifyServerConfig('core', 'shareapi_enforce_expire_date', 'no');
- $this->modifyServerConfig('core', 'shareapi_allow_group_sharing', 'yes');
+ $this->deleteServerConfig('core', 'shareapi_enabled');
+ $this->deleteServerConfig('core', 'shareapi_allow_links');
+ $this->deleteServerConfig('core', 'shareapi_allow_public_upload');
+ $this->deleteServerConfig('core', 'shareapi_allow_resharing');
+ $this->deleteServerConfig('files_sharing', 'outgoing_server2server_share_enabled');
+ $this->deleteServerConfig('files_sharing', 'incoming_server2server_share_enabled');
+ $this->deleteServerConfig('core', 'shareapi_enforce_links_password');
+ $this->deleteServerConfig('core', 'shareapi_allow_public_notification');
+ $this->deleteServerConfig('core', 'shareapi_default_expire_date');
+ $this->deleteServerConfig('core', 'shareapi_enforce_expire_date');
+ $this->deleteServerConfig('core', 'shareapi_allow_group_sharing');
}
}
diff --git a/build/integration/features/bootstrap/FederationContext.php b/build/integration/features/bootstrap/FederationContext.php
index 13e0de46187..e119f950a46 100644
--- a/build/integration/features/bootstrap/FederationContext.php
+++ b/build/integration/features/bootstrap/FederationContext.php
@@ -97,7 +97,7 @@ class FederationContext implements Context, SnippetAcceptingContext {
}
protected function resetAppConfigs() {
- $this->modifyServerConfig('files_sharing', 'incoming_server2server_group_share_enabled', 'no');
- $this->modifyServerConfig('files_sharing', 'outgoing_server2server_group_share_enabled', 'no');
+ $this->deleteServerConfig('files_sharing', 'incoming_server2server_group_share_enabled');
+ $this->deleteServerConfig('files_sharing', 'outgoing_server2server_group_share_enabled');
}
}
diff --git a/build/integration/features/bootstrap/ShareesContext.php b/build/integration/features/bootstrap/ShareesContext.php
index 64896a82009..adfc63c0634 100644
--- a/build/integration/features/bootstrap/ShareesContext.php
+++ b/build/integration/features/bootstrap/ShareesContext.php
@@ -36,8 +36,8 @@ class ShareesContext implements Context, SnippetAcceptingContext {
use AppConfiguration;
protected function resetAppConfigs() {
- $this->modifyServerConfig('core', 'shareapi_only_share_with_group_members', 'no');
- $this->modifyServerConfig('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes');
- $this->modifyServerConfig('core', 'shareapi_allow_group_sharing', 'yes');
+ $this->deleteServerConfig('core', 'shareapi_only_share_with_group_members');
+ $this->deleteServerConfig('core', 'shareapi_allow_share_dialog_user_enumeration');
+ $this->deleteServerConfig('core', 'shareapi_allow_group_sharing');
}
}
diff --git a/build/integration/features/bootstrap/SharingContext.php b/build/integration/features/bootstrap/SharingContext.php
index 447b8f1c024..b1a4c1aa48b 100644
--- a/build/integration/features/bootstrap/SharingContext.php
+++ b/build/integration/features/bootstrap/SharingContext.php
@@ -37,7 +37,13 @@ class SharingContext implements Context, SnippetAcceptingContext {
use CommandLine;
protected function resetAppConfigs() {
- $this->modifyServerConfig('core', 'shareapi_default_permissions', '31');
- $this->modifyServerConfig('sharebymail', 'enforcePasswordProtection', 'no');
+ $this->deleteServerConfig('core', 'shareapi_default_permissions');
+ $this->deleteServerConfig('core', 'shareapi_default_internal_expire_date');
+ $this->deleteServerConfig('core', 'shareapi_internal_expire_after_n_days');
+ $this->deleteServerConfig('core', 'internal_defaultExpDays');
+ $this->deleteServerConfig('core', 'shareapi_default_expire_date');
+ $this->deleteServerConfig('core', 'shareapi_expire_after_n_days');
+ $this->deleteServerConfig('core', 'link_defaultExpDays');
+ $this->deleteServerConfig('sharebymail', 'enforcePasswordProtection');
}
}
diff --git a/build/integration/sharing_features/sharing-v1.feature b/build/integration/sharing_features/sharing-v1.feature
index 38eb2d8a812..b5b4f5341af 100644
--- a/build/integration/sharing_features/sharing-v1.feature
+++ b/build/integration/sharing_features/sharing-v1.feature
@@ -391,6 +391,112 @@ Feature: sharing
And Share fields of last share match with
| permissions | 7 |
+ Scenario: Creating a new internal share with default expiration date
+ Given user "user0" exists
+ And user "user1" exists
+ And As an "user0"
+ And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes"
+ And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3"
+ When creating a share with
+ | path | welcome.txt |
+ | shareWith | user1 |
+ | shareType | 0 |
+ And the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Getting info of last share
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Share fields of last share match with
+ | expiration | +3 days |
+
+ Scenario: Creating a new internal share with relaxed default expiration date
+ Given user "user0" exists
+ And user "user1" exists
+ And As an "user0"
+ And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes"
+ And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3"
+ And parameter "internal_defaultExpDays" of app "core" is set to "1"
+ When creating a share with
+ | path | welcome.txt |
+ | shareWith | user1 |
+ | shareType | 0 |
+ And the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Getting info of last share
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Share fields of last share match with
+ | expiration | +1 days |
+
+ Scenario: Creating a new internal share with relaxed default expiration date too large
+ Given user "user0" exists
+ And user "user1" exists
+ And As an "user0"
+ And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes"
+ And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3"
+ And parameter "internal_defaultExpDays" of app "core" is set to "10"
+ When creating a share with
+ | path | welcome.txt |
+ | shareWith | user1 |
+ | shareType | 0 |
+ And the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Getting info of last share
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Share fields of last share match with
+ | expiration | +3 days |
+
+ Scenario: Creating a new link share with default expiration date
+ Given user "user0" exists
+ And As an "user0"
+ And parameter "shareapi_default_expire_date" of app "core" is set to "yes"
+ And parameter "shareapi_expire_after_n_days" of app "core" is set to "3"
+ When creating a share with
+ | path | welcome.txt |
+ | shareType | 3 |
+ And the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Getting info of last share
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Share fields of last share match with
+ | expiration | +3 days |
+
+ Scenario: Creating a new link share with relaxed default expiration date
+ Given user "user0" exists
+ And As an "user0"
+ And parameter "shareapi_default_expire_date" of app "core" is set to "yes"
+ And parameter "shareapi_expire_after_n_days" of app "core" is set to "3"
+ And parameter "link_defaultExpDays" of app "core" is set to "1"
+ When creating a share with
+ | path | welcome.txt |
+ | shareType | 3 |
+ And the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Getting info of last share
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Share fields of last share match with
+ | expiration | +1 days |
+
+ Scenario: Creating a new link share with relaxed default expiration date too large
+ Given user "user0" exists
+ And As an "user0"
+ And parameter "shareapi_default_expire_date" of app "core" is set to "yes"
+ And parameter "shareapi_expire_after_n_days" of app "core" is set to "3"
+ And parameter "link_defaultExpDays" of app "core" is set to "10"
+ When creating a share with
+ | path | welcome.txt |
+ | shareType | 3 |
+ And the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Getting info of last share
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Share fields of last share match with
+ | expiration | +3 days |
+
Scenario: getting all shares of a user using that user
Given user "user0" exists
And user "user1" exists