From a7f95671effdf452fc88e8362aa1b3cc0dff032d Mon Sep 17 00:00:00 2001
From: Julian Rother <julian@jrother.eu>
Date: Tue, 20 Aug 2024 16:41:31 +0200
Subject: [PATCH] Update docs URL in README and fix typos

---
 README.md                        |  2 +-
 docs/api.rst                     |  2 +-
 ldapserver/entries.py            |  8 ++++----
 ldapserver/schema/definitions.py |  2 +-
 ldapserver/schema/types.py       |  8 ++++----
 ldapserver/server.py             | 18 ++++++++++--------
 6 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/README.md b/README.md
index 08d581c..47daff0 100644
--- a/README.md
+++ b/README.md
@@ -5,5 +5,5 @@ Python library that implements the socketserver.BaseRequestHandler interface
 for LDAP. It provides stubs for all operations (BIND, SEARCH, ...). Overwrite
 the stubs you need to provide actual functionality.
 
-See the [documentation](https://uffd.pages.git.cccv.de/python-ldapserver) for
+See the [documentation](https://uffd.cccv-pages.de/python-ldapserver) for
 further details.
diff --git a/docs/api.rst b/docs/api.rst
index 23ba4f4..4e862fd 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -60,7 +60,7 @@ Schema
 The :class:`schema.Schema` class and the schema-bound classes like :class:`schema.Syntax` provide a high-level interface to the low-level schema definition objects.
 
 Objects of the schema-bound classes reference other objects within their schema directly.
-They are automatically instanciated when a :any:`schema.Schema` object is created based on the passed definition objects.
+They are automatically instantiated when a :any:`schema.Schema` object is created based on the passed definition objects.
 
 .. autoclass:: ldapserver.schema.Schema
 	:members:
diff --git a/ldapserver/entries.py b/ldapserver/entries.py
index 06b0727..436106f 100644
--- a/ldapserver/entries.py
+++ b/ldapserver/entries.py
@@ -306,7 +306,7 @@ class RootDSE(Entry):
 	'''Root DSA-specific (server-specific) Entry
 
 	Root of the Directory Information Tree (DIT). It's always identified by the
-	emtpy DN. Provides information about the server, like supported features.'''
+	empty DN. Provides information about the server, like supported features.'''
 	def __init__(self, schema, **attributes):
 		super().__init__(schema, DN(schema), **attributes)
 		self.setdefault('objectClass', ['top'])
@@ -333,9 +333,9 @@ class EntryTemplate(AttributeDict):
 	'''Utility class for dynamically generated object entries
 
 	Set all entry-specific attributes to the special :data:`WILDCARD` value
-	and call :any:EntryTemplate.match_search` to decide if any entries based
+	and call :any:`EntryTemplate.match_search` to decide if any entries based
 	on the template might match a SEARCH request. Call
-	:any:EntryTemplate.create_entry` with the actual values to create entries
+	:any:`EntryTemplate.create_entry` with the actual values to create entries
 	based on a template.'''
 	def __init__(self, schema, parent_dn, rdn_attribute, **attributes):
 		super().__init__(schema, **attributes)
@@ -537,7 +537,7 @@ class EntryTemplate(AttributeDict):
 		return constraints
 
 	def create_entry(self, rdn_value, **attributes):
-		'''Instanciate :class:`Entry` based on template
+		'''Instantiate :class:`Entry` based on template
 
 		:param rdn_value: RDN value for DN construction
 		:type rdn_value: any
diff --git a/ldapserver/schema/definitions.py b/ldapserver/schema/definitions.py
index 3943cda..6833bcf 100644
--- a/ldapserver/schema/definitions.py
+++ b/ldapserver/schema/definitions.py
@@ -277,7 +277,7 @@ class MatchingRuleDefinition:
 		raise exceptions.LDAPInappropriateMatching()
 
 	def match_approx(self, schema, attribute_values, assertion_value):
-		'''Return whether any attribute value approximatly equals the assertion value
+		'''Return whether any attribute value approximately equals the assertion value
 
 		Only available for EQUALITY matching rules.
 
diff --git a/ldapserver/schema/types.py b/ldapserver/schema/types.py
index aba3bed..25b2406 100644
--- a/ldapserver/schema/types.py
+++ b/ldapserver/schema/types.py
@@ -31,7 +31,7 @@ class Syntax:
 		for tag in definition.compatability_tags:
 			syntaxes_by_tag.setdefault(tag, set()).add(self)
 		# Populated by MatchingRule.__init__
-		#: Set of all matching rules wihin the schema that can be applied to values of the syntax
+		#: Set of all matching rules within the schema that can be applied to values of the syntax
 		self.compatible_matching_rules = set()
 
 	def __repr__(self):
@@ -103,7 +103,7 @@ class EqualityMatchingRule(MatchingRule):
 		return self.definition.match_equal(self.schema, attribute_values, assertion_value)
 
 	def match_approx(self, attribute_values, assertion_value):
-		'''Return whether any attribute value approximatly equals the assertion value
+		'''Return whether any attribute value approximately equals the assertion value
 
 		:returns: True if any attribute values matches, False otherwise
 		:rtype: bool
@@ -272,7 +272,7 @@ class AttributeType:
 		return self.substr.match_substr(attribute_values, inital_substring, any_substrings, final_substring)
 
 	def match_approx(self, attribute_values, assertion_value):
-		'''Return whether any attribute value approximatly equals the assertion value
+		'''Return whether any attribute value approximately equals the assertion value
 
 		:param attribute_values: Attribute values (type according to syntax)
 		:type attribute_values: List of any
@@ -351,7 +351,7 @@ class AttributeType:
 		return matching_rule.match_extensible(attribute_values, assertion_value)
 
 class ObjectClass:
-	'''Representation of an object class wihin a schema'''
+	'''Representation of an object class within a schema'''
 	def __init__(self, schema, definition):
 		#:
 		self.schema = schema
diff --git a/ldapserver/server.py b/ldapserver/server.py
index 4157b0a..5f1cc15 100644
--- a/ldapserver/server.py
+++ b/ldapserver/server.py
@@ -54,7 +54,7 @@ class BaseLDAPRequestHandler(socketserver.BaseRequestHandler):
 	#:
 	#: For every connection the logger object is wrapped with a
 	#: :any:`logging.LoggerAdapter` that prefixes messages with a unique token
-	#: for connetcion tracing.
+	#: for connection tracing.
 	logger = logging.getLogger('ldapserver.server')
 
 	def setup(self):
@@ -177,7 +177,7 @@ class LDAPRequestHandler(BaseLDAPRequestHandler):
 	subschema = entries.SubschemaSubentry(schema.RFC4519_SCHEMA, 'cn=Subschema', cn=['Subschema'])
 
 	#: :class:`RootDSE` object containing information about the server, such
-	#: as supported extentions and SASL authentication mechansims. Content is
+	#: as supported extensions and SASL authentication mechanisms. Content is
 	#: determined on setup based on the `supports_*` attributes. Returned by
 	#: :any:`do_search`.
 	rootdse: typing.Any
@@ -335,7 +335,7 @@ class LDAPRequestHandler(BaseLDAPRequestHandler):
 		of bytes. Whether a challenge or response may or must be absent or present
 		is defined by the individual SASL mechanism.
 
-		IANA list of SASL mechansims: https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml
+		IANA list of SASL mechanisms: https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml
 		'''
 		if not mechanism:
 			# Request to abort current negotiation (RFC4513 5.2.1.2)
@@ -509,14 +509,14 @@ class LDAPRequestHandler(BaseLDAPRequestHandler):
 		:rtype: Iterable of :class:`Entry`
 
 		The default implementation yields :any:`rootdse` and :any:`subschema`.
-		Both are importent for feature detection, so make sure to also return
+		Both are important for feature detection, so make sure to also return
 		them (e.g. with ``yield from super().do_search(...)``).
 
 		For every returned object :any:`Entry.search` is called to filter out
 		non-matching entries and to construct the response.
 
-		Note that if this method is as an iterator, its execution may be paused
-		for extended periods of time or aborted prematurly.'''
+		Note that if this method is a generator, its execution may be paused
+		for extended periods of time or aborted prematurely.'''
 		yield self.rootdse
 		yield self.subschema
 
@@ -604,8 +604,10 @@ class LDAPRequestHandler(BaseLDAPRequestHandler):
 
 	@property
 	def supports_starttls(self):
-		'''
-		'''
+		'''Indicate StartTLS support
+
+		:any:`True` per default if :any:`ssl_context` is set and the connection is
+		not already encrypted, :any:`False` otherwise.'''
 		return self.ssl_context is not None and not isinstance(self.request, ssl.SSLSocket)
 
 	def do_starttls(self):
-- 
GitLab