Skip to content

Commit 00b8dc7

Browse files
committed
🎨 Do not pass debug flag through class hierarchy
1 parent 94f452b commit 00b8dc7

File tree

6 files changed

+4
-16
lines changed

6 files changed

+4
-16
lines changed

apricot/apricot_server.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ def __init__(
6060
@param tls_certificate: TLS certificate for LDAPS
6161
@param tls_private_key: TLS private key for LDAPS
6262
"""
63-
self.debug = debug
64-
6563
# Set up Python root logger
6664
logging.basicConfig(
6765
level=logging.INFO,
@@ -102,7 +100,6 @@ def __init__(
102100
oauth_client = oauth_backend(
103101
client_id=client_id,
104102
client_secret=client_secret,
105-
debug=debug,
106103
uid_cache=uid_cache,
107104
**{k: v for k, v in kwargs.items() if k in oauth_backend_args},
108105
)

apricot/ldap/oauth_ldap_server_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ def buildProtocol(self: Self, addr: IAddress) -> Protocol: # noqa: N802
4646
@param addr: an object implementing L{IAddress}
4747
"""
4848
id(addr) # ignore unused arguments
49-
proto = ReadOnlyLDAPServer(debug=self.adaptor.debug)
49+
proto = ReadOnlyLDAPServer()
5050
proto.factory = self.adaptor
5151
return proto

apricot/ldap/oauth_ldap_tree.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def __init__(
3737
@param refresh_interval: Interval in seconds after which the tree must be refreshed
3838
"""
3939
self.background_refresh = background_refresh
40-
self.debug = oauth_client.debug
4140
self.last_update = time.monotonic()
4241
self.logger = Logger()
4342
self.oauth_adaptor = oauth_adaptor

apricot/ldap/read_only_ldap_server.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,10 @@
3030
class ReadOnlyLDAPServer(LDAPServer):
3131
"""A read-only LDAP server."""
3232

33-
def __init__(self: Self, *, debug: bool = False) -> None:
34-
"""Initialise a ReadOnlyLDAPServer.
35-
36-
@param debug: Enable debug output
37-
"""
38-
self.logger = Logger()
33+
def __init__(self: Self) -> None:
34+
"""Initialise a ReadOnlyLDAPServer."""
3935
super().__init__()
40-
self.debug = debug
36+
self.logger = Logger()
4137

4238
def getRootDSE( # noqa: N802
4339
self: Self,

apricot/oauth/oauth_client.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def __init__(
2727
self: Self,
2828
client_id: str,
2929
client_secret: str,
30-
debug: bool, # noqa: FBT001
3130
redirect_uri: str,
3231
scopes_application: list[str],
3332
scopes_delegated: list[str],
@@ -38,7 +37,6 @@ def __init__(
3837
3938
@param client_id: OAuth client ID
4039
@param client_secret: OAuth client secret
41-
@param debug: Enable debug output
4240
@param redirect_uri: OAuth redirect URI
4341
@param scopes: OAuth scopes
4442
@param token_url: OAuth token URL
@@ -47,7 +45,6 @@ def __init__(
4745
# Set attributes
4846
self.bearer_token_: str | None = None
4947
self.client_secret = client_secret
50-
self.debug = debug
5148
self.logger = Logger()
5249
self.token_url = token_url
5350
self.uid_cache = uid_cache

apricot/oauth/oauth_data_adaptor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def __init__(
4343
@param enable_user_domain_verification: Whether to verify users belong to the correct domain
4444
@param oauth_client: An OAuth client used to construct the LDAP tree
4545
"""
46-
self.debug = oauth_client.debug
4746
self.domain = domain
4847
self.enable_mirrored_groups = enable_mirrored_groups
4948
self.enable_primary_groups = enable_primary_groups

0 commit comments

Comments
 (0)