Verified Commit 18b79e5d authored by Jakob Moser's avatar Jakob Moser
Browse files

Make server field public

parent e5bb46e0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
[project]
name = "ldap"
version = "0.2.0"
version = "0.3.0"
authors = [
  { name="Jakob Moser", email="moser@cl.uni-heidelberg.de" },
]
+2 −2
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ class Directory:
        # parameter is superfluous. However, setting it to true means that if there ever is a case where no scheme is
        # specified (e.g. if someone ever deletes the scheme-enforcing code above), the connection will fall back to
        # use SSL, and I believe that is a good way for things to be.
        self.__server = Server(
        self.server = Server(
            self.ldap_server_url,
            use_ssl=True,
            tls=Tls(
@@ -72,7 +72,7 @@ class Directory:
        user_dn = self._get_user_dn(username)

        try:
            with Connection(self.__server, user=user_dn, password=password):
            with Connection(self.server, user=user_dn, password=password):
                # This will implicitly perform a bind (as, by default, lazy=False). If it succeeds, the user was
                # authenticated against the LDAP server, meaning the credentials are valid.
                # Binding actually seems to be enough, see e.g. https://auth0.com/blog/using-ldap-with-c-sharp/
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ requires-python = ">=3.12"

[[package]]
name = "ldap"
version = "0.1.0"
version = "0.3.0"
source = { editable = "." }
dependencies = [
    { name = "ldap3" },