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

Fix: return non-empty value if trimming is not required #13

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

pgbv
Copy link
Contributor

@pgbv pgbv commented Jun 24, 2024

Currently function returns an empty string if "cn=" or "ou=" trimming is not required.
This one-line PR fixes this behavior.

Checklist for Pull Requests


@CLAassistant
Copy link

CLAassistant commented Jun 24, 2024

CLA assistant check
All committers have signed the CLA.

@drakkan
Copy link
Member

drakkan commented Jun 24, 2024

Hello,

thanks for this PR, can you please also add a test case here?

Signed-off-by: pgbv <48351741+pgbv@users.noreply.github.com>
@pgbv
Copy link
Contributor Author

pgbv commented Jun 24, 2024

Returned the check for an empty string back.
Should be correct now.

@drakkan
Copy link
Member

drakkan commented Jun 24, 2024

Ok, thanks. Before merging and changing the previous behavior, I would like to better understand your use case and the attribute entry returned by your ldap server (is it Active Directory or something else?)

@pgbv
Copy link
Contributor Author

pgbv commented Jun 24, 2024

Sure.
Basically we're trying to make the matching via static groups (instead of using dynamic groups based on the memberOf attribute).
In static groups the value of the attribute usually doesn't require any trimming and the entire value is used.

Would be nice to have a workaround for OpenLDAP servers without memberOf overlay enabled.

@drakkan
Copy link
Member

drakkan commented Jun 24, 2024

This will take some time to ensure that the change does not break other use cases. Please be patient.

@pgbv
Copy link
Contributor Author

pgbv commented Jun 24, 2024

Sure, no pressure ;)
Thanks for your work and a such fast reply.

@drakkan drakkan merged commit bbb7149 into sftpgo:main Aug 21, 2024
5 checks passed
@sftpgo sftpgo locked as resolved and limited conversation to collaborators Aug 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants