Repository navigation
Conversation
spaceone
force-pushed
the
refactor/controls-api
branch
from
October 19, 2026 20:56
687c75d to
5ac36fa
Compare
…lasses Introduce automatic registration of LDAP response controls through `ResponseControl.__init_subclass__()`, eliminating the need for explicit registration statements in individual control modules. Previously, each response control implementation had to manually add itself to the global `KNOWN_RESPONSE_CONTROLS` registry. This duplicated registration logic across modules. Centralize this behavior in the `ResponseControl` base class so that subclasses are automatically registered when they are defined. - Add `ResponseControl.__init_subclass__()` to automatically register subclasses with a defined `controlType` in `KNOWN_RESPONSE_CONTROLS`. - Skip registration for subclasses without a control type, allowing abstract and intermediate control classes to remain unregistered. - Use `dict.setdefault()` to preserve existing registrations and avoid overwriting previously registered implementations for the same OID. - Remove redundant manual registration statements from response control implementations across all builtin control modules. This simplifies the implementation of new response controls, reduces boilerplate, and keeps registration behavior consistent throughout the control hierarchy. Third-party response control implementations also benefit from automatic registration when subclassing `ResponseControl` and defining a valid `controlType`, without requiring explicit registry modifications.
spaceone
force-pushed
the
refactor/controls-api
branch
2 times, most recently
from
October 19, 2026 21:21
a690334 to
74778bf
Compare
Standardize LDAP control implementations around the shorter `encode()` and `decode()` methods, simplify control initialization, and improve consistency across request and response control handling. - Introduce `encode()` and `decode()` methods in the base control classes, retaining the legacy `encodeControlValue()` and `decodeControlValue()` methods as fallback implementations. - Migrate concrete request and response controls to override the new methods instead of their legacy counterparts. - Update `RequestControlTuples()` and `DecodeControlTuples()` to use the unified encoding and decoding interfaces. - Preserve class-level control OIDs in `RequestControl` when no explicit control type is supplied. - Initialize control subclasses through `super().__init__()` to consistently populate control types and criticality flags. - Define class-level control OIDs for ManageDSAIT, Relax Rules, and Proxy Authorization controls. - Allow callers to configure criticality for ManageDSAIT and Relax Rules controls instead of silently forcing it to false. - Accept arbitrary sequences instead of requiring lists in control tuple conversion helpers. - Simplify response control registration lookups, instantiation, and handling of unknown or malformed controls. - Use an explicit `None` check for the response control registry to preserve intentionally empty registries. - Rename internal variables and parameters for consistency and readability. - Rename the legacy `LDAPControl` constructor argument from `encodedControlValue` to `value` and store it accordingly. Concrete controls now implement `encode()` and `decode()` instead of `encodeControlValue()` and `decodeControlValue()`. Applications calling the legacy methods directly should migrate to the new API. Backwards compatibility will be removed in 4.0. The `LDAPControl` constructor also replaces `encodedControlValue` with `value`, and the control tuple helper functions rename their parameters, affecting callers that use keyword arguments.
spaceone
force-pushed
the
refactor/controls-api
branch
from
October 19, 2026 21:41
74778bf to
d4a0dea
Compare
spaceone
force-pushed
the
refactor/code-cleanup
branch
7 times, most recently
from
October 25, 2026 08:15
7778b21 to
23b2128
Compare
spaceone
force-pushed
the
refactor/code-cleanup
branch
from
October 25, 2026 21:21
23b2128 to
2985b30
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
And: