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

Add tls_kwargs config to configure underlying ldap3 package tls #273

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

consideRatio
Copy link
Member

@consideRatio consideRatio commented Sep 19, 2024

And together with #258, I think its fair to say this also...

I didn't want to add several separate config options of what can be configured in the ldap3 package through LDAPAuthenticator, so I instead added tls_kvargs and referenced ldap3 docs and source code for details. Like this we avoid maintenance and a layer that de-couples users from ldap3 which really does the work related to TLS anyhow.

@@ -94,6 +95,29 @@ def _observe_use_ssl(self, change):
""",
)

tls_kvargs = Dict(
Copy link
Member

Choose a reason for hiding this comment

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

keyword arguments are ~always called kwargs. Or are these something different?

Suggested change
tls_kvargs = Dict(
tls_kwargs = Dict(

Copy link
Member Author

Choose a reason for hiding this comment

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

Aaaaaaaaaah thanks for catching this!! I felt something was off but I didn't figure out what.

await authenticator.get_authenticated_user(
None, {"username": "leela", "password": "leela"}
)
except LDAPSSLConfigurationError:
Copy link
Member

@minrk minrk Sep 20, 2024

Choose a reason for hiding this comment

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

usually use with pytest.raises(LDAPSSLConfigurationError): for this pattern

@consideRatio
Copy link
Member Author

@minrk I rebased, fixed a commit message, and changed kvargs to kwargs and mentions of a "key value pairs" was updated to "keyword arguments", and adjusted to use pytest.raises.

@consideRatio
Copy link
Member Author

Thank you for reviewing @minrk!!!!!

@minrk minrk changed the title Add tls_kvargs config to configure underlying ldap3 package tls Add tls_kwargs config to configure underlying ldap3 package tls Sep 20, 2024
@minrk minrk merged commit 1ed49d7 into jupyterhub:main Sep 20, 2024
7 checks passed
@minrk
Copy link
Member

minrk commented Sep 20, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A single issue to represent various SSL/TLS issues Allow configuring ldap3's TLSObject/SSLContext
2 participants