Skip to content

Conversation

@come-nc
Copy link
Contributor

@come-nc come-nc commented Jan 30, 2025

Summary

To help debugging issues related to LDAP configuration, this command shows how Nextcloud sees a specific LDAP user, and if provided an associated group.
This should help debugging situations where group<>member association is not working as expected, and may also help in any situation where LDAP configuration is involved.

Copie d'écran_20250130_120330

Checklist

@come-nc come-nc added the 2. developing Work in progress label Jan 30, 2025
@come-nc come-nc added this to the Nextcloud 32 milestone Jan 30, 2025
@come-nc come-nc self-assigned this Jan 30, 2025
@come-nc come-nc requested a review from blizzz as a code owner January 30, 2025 11:03
@come-nc
Copy link
Contributor Author

come-nc commented Jan 30, 2025

I’m quite happy with current state, only thing I would like to add is clearing the cache maybe?

@blizzz
Copy link
Member

blizzz commented Jan 30, 2025

Nifty stuff 🤩 The execute() method is a bit long maybe.

Clearing the cache is useful, but would give it a new command.

@sorbaugh sorbaugh requested a review from Altahrim January 30, 2025 13:03
@come-nc
Copy link
Contributor Author

come-nc commented Jan 30, 2025

Nifty stuff 🤩 The execute() method is a bit long maybe.

Well yeah but it’s not that easy to break into submethods because there are some early return in there to stop earlier.
The failures could be replaced by Exception throwing but the success are harder to do in a clean way. I will keep it like that to avoid spending too much time on this.

Clearing the cache is useful, but would give it a new command.

I now added a --clearcache option because, especially when used together with --debug-log, it makes a lot of sense to do these tests with a clean cache.

@come-nc come-nc added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jan 30, 2025
@come-nc come-nc requested review from a team, provokateurin and skjnldsv and removed request for a team January 30, 2025 15:00
protected function configure(): void {
$this
->setName('ldap:test-user-settings')
->setDescription('Runs tests and show information about user related LDAP settings')
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a better description? I'm unsure what you mean with "Runs tests" 🤔

Copy link
Contributor

@kesselb kesselb left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@AndyScherzinger AndyScherzinger left a comment

Choose a reason for hiding this comment

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

🐘

@come-nc come-nc merged commit 9c3ef8e into master Feb 6, 2025
189 checks passed
@come-nc come-nc deleted the enh/ldap-add-test-settings-command branch February 6, 2025 11:23
@come-nc
Copy link
Contributor Author

come-nc commented Feb 6, 2025

/backport to stable31

@come-nc
Copy link
Contributor Author

come-nc commented Feb 6, 2025

/backport to stable30

@skjnldsv
Copy link
Member

Docs in nextcloud/documentation#12940

@nextcloud-bot nextcloud-bot mentioned this pull request Aug 19, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
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.

Add debug occ command to check that the LDAP group membership is correctly configured

7 participants