Skip to content

Do not invalidate app tokens in case LDAP connection is temporary una…#40152

Merged
pako81 merged 11 commits intoowncloud:masterfrom
pako81:fix-app-tokens-invalidation
Jun 22, 2022
Merged

Do not invalidate app tokens in case LDAP connection is temporary una…#40152
pako81 merged 11 commits intoowncloud:masterfrom
pako81:fix-app-tokens-invalidation

Conversation

@pako81
Copy link
Copy Markdown

@pako81 pako81 commented Jun 20, 2022

…vailable

Description

App tokens are getting deleted in case LDAP connection is temporary not available.

Related Issue

Motivation and Context

Whenever connection to the LDAP server becomes unavailable app tokens are getting deleted after some minutes causing disconnection of connected clients.

How Has This Been Tested?

  1. Create an app token over /settings/personal?sectionid=security and use it to connect a desktop client
  2. Deliberately cutting connection to the LDAP server;
    --> without this fix: app token is getting deleted after some minutes causing disconnection of the desktop client
    --> with this fix: app token is still valid till connection is back.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised

@pako81 pako81 self-assigned this Jun 20, 2022
@pako81 pako81 added this to the development milestone Jun 20, 2022
@pako81 pako81 requested a review from IljaN June 20, 2022 09:05
@owncloud owncloud deleted a comment from update-docs bot Jun 21, 2022
@phil-davis
Copy link
Copy Markdown
Contributor

https://drone.owncloud.com/owncloud/core/36099/10/7

There was 1 error:

1) Test\User\SessionTest::testValidateSessionDisabledUser
Error: Call to a member function getBackendClassName() on null

/drone/src/lib/private/User/Session.php:858
/drone/src/lib/private/User/Session.php:938
/drone/src/lib/private/User/Session.php:266
/drone/src/tests/lib/User/SessionTest.php:1058
phpvfscomposer:///drone/src/lib/composer/phpunit/phpunit/phpunit:97

--

There was 1 failure:

1) Test\User\SessionTest::testGetUser
Expectation failed for method name is "get" when invoked zero or more times
Parameter 0 for invocation OC\User\Manager::get(null, false) does not match expected value.
Failed asserting that null matches expected 'user123'.

/drone/src/lib/private/User/Session.php:857
/drone/src/lib/private/User/Session.php:938
/drone/src/lib/private/User/Session.php:266
/drone/src/tests/lib/User/SessionTest.php:149
phpvfscomposer:///drone/src/lib/composer/phpunit/phpunit/phpunit:97

PHP unit tests need to be sorted out. Acceptance tests are passing, so there is no obvious end-user regression.

Pasquale Tripodi added 2 commits June 22, 2022 17:09
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@pako81 pako81 merged commit 1f51924 into owncloud:master Jun 22, 2022
@pako81 pako81 deleted the fix-app-tokens-invalidation branch June 22, 2022 17:59
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.

3 participants