Skip to content
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

[stable20] Fix default internal expiration date #24159

Merged
merged 15 commits into from
Nov 16, 2020

Conversation

backportbot-nextcloud[bot]
Copy link

backport of #24069

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The test should fail if no exception was thrown, and no exception was
thrown due to a missing configuration parameter. However, the use of
"addToAssertionCount(1)" made the test pass even if no exception was
thrown and, therefore, to silently fail.

Now the missing configuration parameter was added and the test will fail
if the expected exception is not thrown.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The enforced expiration date was not actually enabled, as for that
"shareapi_default_expire_date" needs to be explicitly set to "yes".

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The expiration date was explicitly given, so it was not testing what it
should. Moreover, "link_defaultExpDays" needs to be mapped when testing
the default value (even if it will just fallback to the value of
"shareapi_expire_after_n_days").

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
This adds back what was being actually tested in the unit test fixed in
the previous commit.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
This shows in a clearer way that the expected expiration date is the
original one, but without time.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The default expiration date for internal shares was set from the default
link expiration date instead of the internal one.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
They were copied and adjusted as needed from the tests for
"validateExpirationDate".

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
This avoids the need to keep the default values in the integration tests
in sync with the code, and also makes possible to reset values with
"dynamic" defaults (defaults that depend on other values).

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍

But let's wait for CI :-)

@rullzer rullzer mentioned this pull request Nov 16, 2020
1 task
@danxuliu danxuliu merged commit cdbb2b3 into stable20 Nov 16, 2020
@danxuliu danxuliu deleted the backport/24069/stable20 branch November 16, 2020 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants