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

relax strict getHome behaviour for LDAP users in a shadow state #17717

Merged
merged 5 commits into from
Jan 14, 2020

Conversation

blizzz
Copy link
Member

@blizzz blizzz commented Oct 28, 2019

  • simplifies deletion process

  • less strange behaviour when looking up home storage (as long as it is local)

  • enables transfer ownerships after user went invisible on ldap (* not sure about behviour with external storages requiring auth)

  • storages of deleted ldap users can still be accessed, apart form potential external storages that require auth

  • decouples userExists from an LDAP check, allows for setting deleted state directly, solves some edge cases

  • adapt tests

@blizzz blizzz added this to the Nextcloud 18 milestone Oct 28, 2019
@blizzz blizzz force-pushed the fix/noid/ldap-relax-getHome branch 2 times, most recently from dc9ca91 to 84ed1ed Compare November 18, 2019 12:13
@blizzz blizzz added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Nov 18, 2019
@blizzz blizzz force-pushed the fix/noid/ldap-relax-getHome branch 2 times, most recently from ca5d9ac to 081ffab Compare November 29, 2019 14:27
@blizzz blizzz added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Nov 29, 2019
@mwuttke
Copy link

mwuttke commented Dec 2, 2019

@blizzz: Can you backport this patch for nc 16 and/or nc 17?

Thanks & Greetings,
Michael form Berlin

@blizzz
Copy link
Member Author

blizzz commented Dec 2, 2019

@moodlebeuth Heyo Michael :) As it contains elementary and behavorial changes, I hesitate to pour this into a stable release. On the other hand, the changes made are done with patching older versions in mind, in favour of "better" changes (which still might come in as an additional, explicit commit). So at least it would be easy to apply it to an older series. It's not a definite no however.

Did you try it on a test system yet?

@blizzz blizzz force-pushed the fix/noid/ldap-relax-getHome branch from 081ffab to d3fd735 Compare December 5, 2019 22:40
@blizzz blizzz added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Dec 6, 2019
@blizzz
Copy link
Member Author

blizzz commented Dec 6, 2019

Some tests are failing also because of #18254, but another LDAP integration test, too, which does not seem related however. Let's rebase once #18254 is merged.

This was referenced Dec 11, 2019
@rullzer rullzer mentioned this pull request Dec 19, 2019
18 tasks
@blizzz
Copy link
Member Author

blizzz commented Jan 8, 2020

@rullzer np, probably gonna backport it anyway

@juliusknorr
Copy link
Member

Still a failure:


--- Failed scenarios:
--
260 |  
261 | /drone/src/build/integration/ldap_features/openldap-numerical-id.feature:50

@blizzz
Copy link
Member Author

blizzz commented Jan 8, 2020

yep

Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

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

Looks good otherwise 👍

@blizzz
Copy link
Member Author

blizzz commented Jan 10, 2020

okay, I know the reason, but have no good way around. yet. We know the user from the previous test scenario (mapped in DB), but the filter has changed. So we would need to check LDAP to see that the user has gone. Previously it would happen through userExists since it did a lookup in LDAP. Now we only report the local state (and a true is necessary to be able to delete a user locally...). Tricky. To be continued.

@blizzz blizzz force-pushed the fix/noid/ldap-relax-getHome branch from d67ef95 to 2411b62 Compare January 13, 2020 16:11
@blizzz blizzz force-pushed the fix/noid/ldap-relax-getHome branch from 2411b62 to 489ed87 Compare January 13, 2020 16:13
@blizzz
Copy link
Member Author

blizzz commented Jan 14, 2020

Tests are passing now. When reading members of a group, and those were already mapped in Nextcloud, but now excluded by a filter, they would pass if not ensured that they are available for Nc.

@blizzz
Copy link
Member Author

blizzz commented Jan 14, 2020

/backport to stable18

@blizzz
Copy link
Member Author

blizzz commented Jan 14, 2020

/backport to stable17

@blizzz
Copy link
Member Author

blizzz commented Jan 14, 2020

/backport to stable16

@backportbot-nextcloud
Copy link

backport to stable18 in #18882

@backportbot-nextcloud
Copy link

The backport to stable17 failed. Please do this backport manually.

@backportbot-nextcloud
Copy link

The backport to stable16 failed. Please do this backport manually.

blizzz added a commit that referenced this pull request Jan 14, 2020
* simplifies deletion process
* less strange behaviour when looking up home storage (as long as it is local)
* thus could enable transfer ownerships after user went invisible on ldap

backport of #17717

Signed-off-by: Arthur Schiwon <[email protected]>

decouple userExists from userExistsOnLDAP check

allows to mark users as offline right away, avoids a gap of being not a
user and causing weird side effects

Signed-off-by: Arthur Schiwon <[email protected]>

adjust tests

Signed-off-by: Arthur Schiwon <[email protected]>

remove superfluous tests

- user_ldap is not exposed to public api, it is always behind ldap_proxy
- this is too much for a unit test
- integration tests cover userExists implicitly

Signed-off-by: Arthur Schiwon <[email protected]>

ensure that only valid group members are returned

Signed-off-by: Arthur Schiwon <[email protected]>
blizzz added a commit that referenced this pull request Jan 14, 2020
* simplifies deletion process
* less strange behaviour when looking up home storage (as long as it is local)
* thus could enable transfer ownerships after user went invisible on ldap

backport of #17717

Signed-off-by: Arthur Schiwon <[email protected]>

decouple userExists from userExistsOnLDAP check

allows to mark users as offline right away, avoids a gap of being not a
user and causing weird side effects

Signed-off-by: Arthur Schiwon <[email protected]>

adjust tests

Signed-off-by: Arthur Schiwon <[email protected]>

remove superfluous tests

- user_ldap is not exposed to public api, it is always behind ldap_proxy
- this is too much for a unit test
- integration tests cover userExists implicitly

Signed-off-by: Arthur Schiwon <[email protected]>

ensure that only valid group members are returned

Signed-off-by: Arthur Schiwon <[email protected]>
juliusknorr pushed a commit that referenced this pull request Jan 23, 2020
* simplifies deletion process
* less strange behaviour when looking up home storage (as long as it is local)
* thus could enable transfer ownerships after user went invisible on ldap

backport of #17717

Signed-off-by: Arthur Schiwon <[email protected]>

decouple userExists from userExistsOnLDAP check

allows to mark users as offline right away, avoids a gap of being not a
user and causing weird side effects

Signed-off-by: Arthur Schiwon <[email protected]>

adjust tests

Signed-off-by: Arthur Schiwon <[email protected]>

remove superfluous tests

- user_ldap is not exposed to public api, it is always behind ldap_proxy
- this is too much for a unit test
- integration tests cover userExists implicitly

Signed-off-by: Arthur Schiwon <[email protected]>

ensure that only valid group members are returned

Signed-off-by: Arthur Schiwon <[email protected]>
blizzz added a commit that referenced this pull request Feb 27, 2020
* simplifies deletion process
* less strange behaviour when looking up home storage (as long as it is local)
* thus could enable transfer ownerships after user went invisible on ldap

backport of #17717

Signed-off-by: Arthur Schiwon <[email protected]>

decouple userExists from userExistsOnLDAP check

allows to mark users as offline right away, avoids a gap of being not a
user and causing weird side effects

Signed-off-by: Arthur Schiwon <[email protected]>

adjust tests

Signed-off-by: Arthur Schiwon <[email protected]>

remove superfluous tests

- user_ldap is not exposed to public api, it is always behind ldap_proxy
- this is too much for a unit test
- integration tests cover userExists implicitly

Signed-off-by: Arthur Schiwon <[email protected]>

ensure that only valid group members are returned

Signed-off-by: Arthur Schiwon <[email protected]>
blizzz added a commit that referenced this pull request Feb 27, 2020
* simplifies deletion process
* less strange behaviour when looking up home storage (as long as it is local)
* thus could enable transfer ownerships after user went invisible on ldap

backport of #17717

Signed-off-by: Arthur Schiwon <[email protected]>

decouple userExists from userExistsOnLDAP check

allows to mark users as offline right away, avoids a gap of being not a
user and causing weird side effects

Signed-off-by: Arthur Schiwon <[email protected]>

adjust tests

Signed-off-by: Arthur Schiwon <[email protected]>

remove superfluous tests

- user_ldap is not exposed to public api, it is always behind ldap_proxy
- this is too much for a unit test
- integration tests cover userExists implicitly

Signed-off-by: Arthur Schiwon <[email protected]>

ensure that only valid group members are returned

Signed-off-by: Arthur Schiwon <[email protected]>

fixup! relax strict getHome behaviour for LDAP users in a shadow state

fixup! relax strict getHome behaviour for LDAP users in a shadow state
blizzz added a commit that referenced this pull request Feb 28, 2020
* simplifies deletion process
* less strange behaviour when looking up home storage (as long as it is local)
* thus could enable transfer ownerships after user went invisible on ldap

backport of #17717

Signed-off-by: Arthur Schiwon <[email protected]>

decouple userExists from userExistsOnLDAP check

allows to mark users as offline right away, avoids a gap of being not a
user and causing weird side effects

Signed-off-by: Arthur Schiwon <[email protected]>

adjust tests

Signed-off-by: Arthur Schiwon <[email protected]>

remove superfluous tests

- user_ldap is not exposed to public api, it is always behind ldap_proxy
- this is too much for a unit test
- integration tests cover userExists implicitly

Signed-off-by: Arthur Schiwon <[email protected]>

ensure that only valid group members are returned

Signed-off-by: Arthur Schiwon <[email protected]>
blizzz added a commit that referenced this pull request Feb 28, 2020
* simplifies deletion process
* less strange behaviour when looking up home storage (as long as it is local)
* thus could enable transfer ownerships after user went invisible on ldap

backport of #17717

Signed-off-by: Arthur Schiwon <[email protected]>

decouple userExists from userExistsOnLDAP check

allows to mark users as offline right away, avoids a gap of being not a
user and causing weird side effects

Signed-off-by: Arthur Schiwon <[email protected]>

adjust tests

Signed-off-by: Arthur Schiwon <[email protected]>

remove superfluous tests

- user_ldap is not exposed to public api, it is always behind ldap_proxy
- this is too much for a unit test
- integration tests cover userExists implicitly

Signed-off-by: Arthur Schiwon <[email protected]>

ensure that only valid group members are returned

Signed-off-by: Arthur Schiwon <[email protected]>
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.

5 participants