diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index bf3e5e008cad..7122679b9be9 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -32,6 +32,7 @@ "stubs/humanfriendly", "stubs/jmespath", "stubs/jsonschema", + "stubs/ldap3", "stubs/Markdown", "stubs/mysqlclient", "stubs/oauthlib", diff --git a/stubs/ldap3/@tests/stubtest_allowlist.txt b/stubs/ldap3/@tests/stubtest_allowlist.txt new file mode 100644 index 000000000000..71eb99da0822 --- /dev/null +++ b/stubs/ldap3/@tests/stubtest_allowlist.txt @@ -0,0 +1 @@ +ldap3.protocol.sasl.kerberos # requires gssapi package to import diff --git a/stubs/ldap3/METADATA.toml b/stubs/ldap3/METADATA.toml new file mode 100644 index 000000000000..77ff5706c1d9 --- /dev/null +++ b/stubs/ldap3/METADATA.toml @@ -0,0 +1,2 @@ +version = "2.9.*" +requires = [] # requires types-pyasn1 (not available yet) diff --git a/stubs/ldap3/ldap3/__init__.pyi b/stubs/ldap3/ldap3/__init__.pyi new file mode 100644 index 000000000000..4f72194fa2bd --- /dev/null +++ b/stubs/ldap3/ldap3/__init__.pyi @@ -0,0 +1,104 @@ +from typing import Any, Tuple, Type +from typing_extensions import Literal + +from .abstract.attrDef import AttrDef as AttrDef +from .abstract.attribute import ( + Attribute as Attribute, + OperationalAttribute as OperationalAttribute, + WritableAttribute as WritableAttribute, +) +from .abstract.cursor import Reader as Reader, Writer as Writer +from .abstract.entry import Entry as Entry, WritableEntry as WritableEntry +from .abstract.objectDef import ObjectDef as ObjectDef +from .core.connection import Connection as Connection +from .core.pooling import ServerPool as ServerPool +from .core.rdns import ReverseDnsSetting as ReverseDnsSetting +from .core.server import Server as Server +from .core.tls import Tls as Tls +from .protocol.rfc4512 import DsaInfo as DsaInfo, SchemaInfo as SchemaInfo +from .utils.config import get_config_parameter as get_config_parameter, set_config_parameter as set_config_parameter +from .version import __description__ as __description__, __status__ as __status__, __url__ as __url__ + +ANONYMOUS: Literal["ANONYMOUS"] +SIMPLE: Literal["SIMPLE"] +SASL: Literal["SASL"] +NTLM: Literal["NTLM"] + +EXTERNAL: Literal["EXTERNAL"] +DIGEST_MD5: Literal["DIGEST-MD5"] +KERBEROS: Literal["GSSAPI"] +GSSAPI: Literal["GSSAPI"] +PLAIN: Literal["PLAIN"] + +AUTO_BIND_DEFAULT: Literal["DEFAULT"] +AUTO_BIND_NONE: Literal["NONE"] +AUTO_BIND_NO_TLS: Literal["NO_TLS"] +AUTO_BIND_TLS_BEFORE_BIND: Literal["TLS_BEFORE_BIND"] +AUTO_BIND_TLS_AFTER_BIND: Literal["TLS_AFTER_BIND"] + +IP_SYSTEM_DEFAULT: Literal["IP_SYSTEM_DEFAULT"] +IP_V4_ONLY: Literal["IP_V4_ONLY"] +IP_V6_ONLY: Literal["IP_V6_ONLY"] +IP_V4_PREFERRED: Literal["IP_V4_PREFERRED"] +IP_V6_PREFERRED: Literal["IP_V6_PREFERRED"] + +BASE: Literal["BASE"] +LEVEL: Literal["LEVEL"] +SUBTREE: Literal["SUBTREE"] + +DEREF_NEVER: Literal["NEVER"] +DEREF_SEARCH: Literal["SEARCH"] +DEREF_BASE: Literal["FINDING_BASE"] +DEREF_ALWAYS: Literal["ALWAYS"] + +ALL_ATTRIBUTES: Literal["*"] +NO_ATTRIBUTES: Literal["1.1"] +ALL_OPERATIONAL_ATTRIBUTES: Literal["+"] + +MODIFY_ADD: Literal["MODIFY_ADD"] +MODIFY_DELETE: Literal["MODIFY_DELETE"] +MODIFY_REPLACE: Literal["MODIFY_REPLACE"] +MODIFY_INCREMENT: Literal["MODIFY_INCREMENT"] + +SYNC: Literal["SYNC"] +SAFE_SYNC: Literal["SAFE_SYNC"] +SAFE_RESTARTABLE: Literal["SAFE_RESTARTABLE"] +ASYNC: Literal["ASYNC"] +LDIF: Literal["LDIF"] +RESTARTABLE: Literal["RESTARTABLE"] +REUSABLE: Literal["REUSABLE"] +MOCK_SYNC: Literal["MOCK_SYNC"] +MOCK_ASYNC: Literal["MOCK_ASYNC"] +ASYNC_STREAM: Literal["ASYNC_STREAM"] + +NONE: Literal["NO_INFO"] +DSA: Literal["DSA"] +SCHEMA: Literal["SCHEMA"] +ALL: Literal["ALL"] + +OFFLINE_EDIR_8_8_8: Literal["EDIR_8_8_8"] +OFFLINE_EDIR_9_1_4: Literal["EDIR_9_1_4"] +OFFLINE_AD_2012_R2: Literal["AD_2012_R2"] +OFFLINE_SLAPD_2_4: Literal["SLAPD_2_4"] +OFFLINE_DS389_1_3_3: Literal["DS389_1_3_3"] + +FIRST: Literal["FIRST"] +ROUND_ROBIN: Literal["ROUND_ROBIN"] +RANDOM: Literal["RANDOM"] + +HASHED_NONE: Literal["PLAIN"] +HASHED_SHA: Literal["SHA"] +HASHED_SHA256: Literal["SHA256"] +HASHED_SHA384: Literal["SHA384"] +HASHED_SHA512: Literal["SHA512"] +HASHED_MD5: Literal["MD5"] +HASHED_SALTED_SHA: Literal["SALTED_SHA"] +HASHED_SALTED_SHA256: Literal["SALTED_SHA256"] +HASHED_SALTED_SHA384: Literal["SALTED_SHA384"] +HASHED_SALTED_SHA512: Literal["SALTED_SHA512"] +HASHED_SALTED_MD5: Literal["SALTED_MD5"] + +NUMERIC_TYPES: Tuple[Type[Any], ...] +INTEGER_TYPES: Tuple[Type[Any], ...] +STRING_TYPES: Tuple[Type[Any], ...] +SEQUENCE_TYPES: Tuple[Type[Any], ...] diff --git a/stubs/ldap3/ldap3/abstract/__init__.pyi b/stubs/ldap3/ldap3/abstract/__init__.pyi new file mode 100644 index 000000000000..5c2b1bd77518 --- /dev/null +++ b/stubs/ldap3/ldap3/abstract/__init__.pyi @@ -0,0 +1,15 @@ +from typing import Any + +STATUS_INIT: str +STATUS_VIRTUAL: str +STATUS_MANDATORY_MISSING: str +STATUS_READ: str +STATUS_WRITABLE: str +STATUS_PENDING_CHANGES: str +STATUS_COMMITTED: str +STATUS_READY_FOR_DELETION: str +STATUS_READY_FOR_MOVING: str +STATUS_READY_FOR_RENAMING: str +STATUS_DELETED: str +STATUSES: Any +INITIAL_STATUSES: Any diff --git a/stubs/ldap3/ldap3/abstract/attrDef.pyi b/stubs/ldap3/ldap3/abstract/attrDef.pyi new file mode 100644 index 000000000000..980262393e08 --- /dev/null +++ b/stubs/ldap3/ldap3/abstract/attrDef.pyi @@ -0,0 +1,33 @@ +from typing import Any + +class AttrDef: + name: Any + key: Any + validate: Any + pre_query: Any + post_query: Any + default: Any + dereference_dn: Any + description: Any + mandatory: Any + single_value: Any + oid_info: Any + other_names: Any + def __init__( + self, + name, + key: Any | None = ..., + validate: Any | None = ..., + pre_query: Any | None = ..., + post_query: Any | None = ..., + default=..., + dereference_dn: Any | None = ..., + description: Any | None = ..., + mandatory: bool = ..., + single_value: Any | None = ..., + alias: Any | None = ..., + ) -> None: ... + def __eq__(self, other): ... + def __lt__(self, other): ... + def __hash__(self): ... + def __setattr__(self, key, value) -> None: ... diff --git a/stubs/ldap3/ldap3/abstract/attribute.pyi b/stubs/ldap3/ldap3/abstract/attribute.pyi new file mode 100644 index 000000000000..d5ed793dbf77 --- /dev/null +++ b/stubs/ldap3/ldap3/abstract/attribute.pyi @@ -0,0 +1,34 @@ +from typing import Any + +class Attribute: + key: Any + definition: Any + values: Any + raw_values: Any + response: Any + entry: Any + cursor: Any + other_names: Any + def __init__(self, attr_def, entry, cursor) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def __getitem__(self, item): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + @property + def value(self): ... + +class OperationalAttribute(Attribute): ... + +class WritableAttribute(Attribute): + def __iadd__(self, other): ... + def __isub__(self, other): ... + def add(self, values) -> None: ... + def set(self, values) -> None: ... + def delete(self, values) -> None: ... + def remove(self) -> None: ... + def discard(self) -> None: ... + @property + def virtual(self): ... + @property + def changes(self): ... diff --git a/stubs/ldap3/ldap3/abstract/cursor.pyi b/stubs/ldap3/ldap3/abstract/cursor.pyi new file mode 100644 index 000000000000..ee27126afca7 --- /dev/null +++ b/stubs/ldap3/ldap3/abstract/cursor.pyi @@ -0,0 +1,102 @@ +from typing import Any, NamedTuple + +class Operation(NamedTuple): + request: Any + result: Any + response: Any + +class Cursor: + connection: Any + get_operational_attributes: Any + definition: Any + attributes: Any + controls: Any + execution_time: Any + entries: Any + schema: Any + def __init__( + self, + connection, + object_def, + get_operational_attributes: bool = ..., + attributes: Any | None = ..., + controls: Any | None = ..., + auxiliary_class: Any | None = ..., + ) -> None: ... + def __iter__(self): ... + def __getitem__(self, item): ... + def __len__(self): ... + def __bool__(self): ... + def match_dn(self, dn): ... + def match(self, attributes, value): ... + def remove(self, entry) -> None: ... + @property + def operations(self): ... + @property + def errors(self): ... + @property + def failed(self): ... + +class Reader(Cursor): + entry_class: Any + attribute_class: Any + entry_initial_status: Any + sub_tree: Any + base: Any + dereference_aliases: Any + validated_query: Any + query_filter: Any + def __init__( + self, + connection, + object_def, + base, + query: str = ..., + components_in_and: bool = ..., + sub_tree: bool = ..., + get_operational_attributes: bool = ..., + attributes: Any | None = ..., + controls: Any | None = ..., + auxiliary_class: Any | None = ..., + ) -> None: ... + @property + def query(self): ... + @query.setter + def query(self, value) -> None: ... + @property + def components_in_and(self): ... + @components_in_and.setter + def components_in_and(self, value) -> None: ... + def clear(self) -> None: ... + execution_time: Any + entries: Any + def reset(self) -> None: ... + def search(self, attributes: Any | None = ...): ... + def search_object(self, entry_dn: Any | None = ..., attributes: Any | None = ...): ... + def search_level(self, attributes: Any | None = ...): ... + def search_subtree(self, attributes: Any | None = ...): ... + def search_paged(self, paged_size, paged_criticality: bool = ..., generator: bool = ..., attributes: Any | None = ...): ... + +class Writer(Cursor): + entry_class: Any + attribute_class: Any + entry_initial_status: Any + @staticmethod + def from_cursor(cursor, connection: Any | None = ..., object_def: Any | None = ..., custom_validator: Any | None = ...): ... + @staticmethod + def from_response(connection, object_def, response: Any | None = ...): ... + dereference_aliases: Any + def __init__( + self, + connection, + object_def, + get_operational_attributes: bool = ..., + attributes: Any | None = ..., + controls: Any | None = ..., + auxiliary_class: Any | None = ..., + ) -> None: ... + execution_time: Any + def commit(self, refresh: bool = ...): ... + def discard(self) -> None: ... + def new(self, dn): ... + def refresh_entry(self, entry, tries: int = ..., seconds: int = ...): ... diff --git a/stubs/ldap3/ldap3/abstract/entry.pyi b/stubs/ldap3/ldap3/abstract/entry.pyi new file mode 100644 index 000000000000..b7392e22cd6d --- /dev/null +++ b/stubs/ldap3/ldap3/abstract/entry.pyi @@ -0,0 +1,83 @@ +from typing import Any + +class EntryState: + dn: Any + status: Any + attributes: Any + raw_attributes: Any + response: Any + cursor: Any + origin: Any + read_time: Any + changes: Any + definition: Any + def __init__(self, dn, cursor) -> None: ... + def set_status(self, status) -> None: ... + @property + def entry_raw_attributes(self): ... + +class EntryBase: + def __init__(self, dn, cursor) -> None: ... + def __iter__(self): ... + def __contains__(self, item): ... + def __getattr__(self, item): ... + def __setattr__(self, item, value) -> None: ... + def __getitem__(self, item): ... + def __eq__(self, other): ... + def __lt__(self, other): ... + @property + def entry_dn(self): ... + @property + def entry_cursor(self): ... + @property + def entry_status(self): ... + @property + def entry_definition(self): ... + @property + def entry_raw_attributes(self): ... + def entry_raw_attribute(self, name): ... + @property + def entry_mandatory_attributes(self): ... + @property + def entry_attributes(self): ... + @property + def entry_attributes_as_dict(self): ... + @property + def entry_read_time(self): ... + def entry_to_json( + self, + raw: bool = ..., + indent: int = ..., + sort: bool = ..., + stream: Any | None = ..., + checked_attributes: bool = ..., + include_empty: bool = ..., + ): ... + def entry_to_ldif( + self, all_base64: bool = ..., line_separator: Any | None = ..., sort_order: Any | None = ..., stream: Any | None = ... + ): ... + +class Entry(EntryBase): + def entry_writable( + self, + object_def: Any | None = ..., + writer_cursor: Any | None = ..., + attributes: Any | None = ..., + custom_validator: Any | None = ..., + auxiliary_class: Any | None = ..., + ): ... + +class WritableEntry(EntryBase): + def __setitem__(self, key, value) -> None: ... + def __setattr__(self, item, value) -> None: ... + def __getattr__(self, item): ... + @property + def entry_virtual_attributes(self): ... + def entry_commit_changes(self, refresh: bool = ..., controls: Any | None = ..., clear_history: bool = ...): ... + def entry_discard_changes(self) -> None: ... + def entry_delete(self) -> None: ... + def entry_refresh(self, tries: int = ..., seconds: int = ...): ... + def entry_move(self, destination_dn) -> None: ... + def entry_rename(self, new_name) -> None: ... + @property + def entry_changes(self): ... diff --git a/stubs/ldap3/ldap3/abstract/objectDef.pyi b/stubs/ldap3/ldap3/abstract/objectDef.pyi new file mode 100644 index 000000000000..31931796f27c --- /dev/null +++ b/stubs/ldap3/ldap3/abstract/objectDef.pyi @@ -0,0 +1,23 @@ +from typing import Any + +class ObjectDef: + def __init__( + self, + object_class: Any | None = ..., + schema: Any | None = ..., + custom_validator: Any | None = ..., + auxiliary_class: Any | None = ..., + ) -> None: ... + def __getitem__(self, item): ... + def __getattr__(self, item): ... + def __setattr__(self, key, value) -> None: ... + def __iadd__(self, other): ... + def __isub__(self, other): ... + def __iter__(self): ... + def __len__(self): ... + def __bool__(self): ... + def __contains__(self, item): ... + def add_from_schema(self, attribute_name, mandatory: bool = ...) -> None: ... + def add_attribute(self, definition: Any | None = ...) -> None: ... + def remove_attribute(self, item) -> None: ... + def clear_attributes(self) -> None: ... diff --git a/stubs/ldap3/ldap3/core/__init__.pyi b/stubs/ldap3/ldap3/core/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/ldap3/ldap3/core/connection.pyi b/stubs/ldap3/ldap3/core/connection.pyi new file mode 100644 index 000000000000..2b21d779b85f --- /dev/null +++ b/stubs/ldap3/ldap3/core/connection.pyi @@ -0,0 +1,170 @@ +from _typeshed import Self +from types import TracebackType +from typing import Any, Type +from typing_extensions import Literal + +from .server import Server + +SASL_AVAILABLE_MECHANISMS: Any +CLIENT_STRATEGIES: Any + +class Connection: + connection_lock: Any + last_error: str + strategy_type: Any + user: Any + password: Any + authentication: Any + version: Any + auto_referrals: Any + request: Any + response: Any | None + result: Any + bound: bool + listening: bool + closed: bool + auto_bind: Any + sasl_mechanism: Any + sasl_credentials: Any + socket: Any + tls_started: bool + sasl_in_progress: bool + read_only: Any + lazy: Any + pool_name: Any + pool_size: int | None + cred_store: Any + pool_lifetime: Any + pool_keepalive: Any + starting_tls: bool + check_names: Any + raise_exceptions: Any + auto_range: Any + extend: Any + fast_decoder: Any + receive_timeout: Any + empty_attributes: Any + use_referral_cache: Any + auto_escape: Any + auto_encode: Any + source_address: Any + source_port_list: Any + server_pool: Any | None + server: Any + strategy: Any + send: Any + open: Any + get_response: Any + post_send_single_response: Any + post_send_search: Any + def __init__( + self, + server: Server | str, + user: str | None = ..., + password: str | None = ..., + auto_bind: Literal["DEFAULT", "NONE", "NO_TLS", "TLS_BEFORE_BIND", "TLS_AFTER_BIND"] = ..., + version: int = ..., + authentication: Literal["ANONYMOUS", "SIMPLE", "SASL", "NTLM"] | None = ..., + client_strategy: Literal[ + "SYNC", "SAFE_SYNC", "ASYNC", "LDIF", "RESTARTABLE", "REUSABLE", "MOCK_SYNC", "MOCK_ASYNC", "ASYNC_STREAM" + ] = ..., + auto_referrals: bool = ..., + auto_range: bool = ..., + sasl_mechanism: str | None = ..., + sasl_credentials: Any | None = ..., + check_names: bool = ..., + collect_usage: bool = ..., + read_only: bool = ..., + lazy: bool = ..., + raise_exceptions: bool = ..., + pool_name: str | None = ..., + pool_size: int | None = ..., + pool_lifetime: int | None = ..., + cred_store: Any | None = ..., + fast_decoder: bool = ..., + receive_timeout: Any | None = ..., + return_empty_attributes: bool = ..., + use_referral_cache: bool = ..., + auto_escape: bool = ..., + auto_encode: bool = ..., + pool_keepalive: Any | None = ..., + source_address: str | None = ..., + source_port: int | None = ..., + source_port_list: Any | None = ..., + ) -> None: ... + def repr_with_sensitive_data_stripped(self): ... + @property + def stream(self): ... + @stream.setter + def stream(self, value) -> None: ... + @property + def usage(self): ... + def __enter__(self: Self) -> Self: ... + def __exit__( + self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> Literal[False] | None: ... + def bind(self, read_server_info: bool = ..., controls: Any | None = ...): ... + def rebind( + self, + user: Any | None = ..., + password: Any | None = ..., + authentication: Any | None = ..., + sasl_mechanism: Any | None = ..., + sasl_credentials: Any | None = ..., + read_server_info: bool = ..., + controls: Any | None = ..., + ): ... + def unbind(self, controls: Any | None = ...): ... + def search( + self, + search_base: str, + search_filter: str, + search_scope: Literal["BASE", "LEVEL", "SUBTREE"] = ..., + dereference_aliases: Literal["NEVER", "SEARCH", "FINDING_BASE", "ALWAYS"] = ..., + attributes: Any | None = ..., + size_limit: int = ..., + time_limit: int = ..., + types_only: bool = ..., + get_operational_attributes: bool = ..., + controls: Any | None = ..., + paged_size: int | None = ..., + paged_criticality: bool = ..., + paged_cookie: str | bytes | None = ..., + auto_escape: bool | None = ..., + ): ... + def compare(self, dn, attribute, value, controls: Any | None = ...): ... + def add(self, dn, object_class: Any | None = ..., attributes: Any | None = ..., controls: Any | None = ...): ... + def delete(self, dn, controls: Any | None = ...): ... + def modify(self, dn, changes, controls: Any | None = ...): ... + def modify_dn( + self, dn, relative_dn, delete_old_dn: bool = ..., new_superior: Any | None = ..., controls: Any | None = ... + ): ... + def abandon(self, message_id, controls: Any | None = ...): ... + def extended( + self, request_name, request_value: Any | None = ..., controls: Any | None = ..., no_encode: Any | None = ... + ): ... + def start_tls(self, read_server_info: bool = ...): ... + def do_sasl_bind(self, controls): ... + def do_ntlm_bind(self, controls): ... + def refresh_server_info(self) -> None: ... + def response_to_ldif( + self, + search_result: Any | None = ..., + all_base64: bool = ..., + line_separator: Any | None = ..., + sort_order: Any | None = ..., + stream: Any | None = ..., + ): ... + def response_to_json( + self, + raw: bool = ..., + search_result: Any | None = ..., + indent: int = ..., + sort: bool = ..., + stream: Any | None = ..., + checked_attributes: bool = ..., + include_empty: bool = ..., + ): ... + def response_to_file(self, target, raw: bool = ..., indent: int = ..., sort: bool = ...) -> None: ... + @property + def entries(self): ... diff --git a/stubs/ldap3/ldap3/core/exceptions.pyi b/stubs/ldap3/ldap3/core/exceptions.pyi new file mode 100644 index 000000000000..9e1cc81383cf --- /dev/null +++ b/stubs/ldap3/ldap3/core/exceptions.pyi @@ -0,0 +1,146 @@ +import socket +from typing import Any, Type, TypeVar + +_T = TypeVar("_T") + +class LDAPException(Exception): ... + +class LDAPOperationResult(LDAPException): + def __new__( + cls: Type[_T], + result: Any | None = ..., + description: Any | None = ..., + dn: Any | None = ..., + message: Any | None = ..., + response_type: Any | None = ..., + response: Any | None = ..., + ) -> _T: ... + result: Any + description: Any + dn: Any + message: Any + type: Any + response: Any + def __init__( + self, + result: Any | None = ..., + description: Any | None = ..., + dn: Any | None = ..., + message: Any | None = ..., + response_type: Any | None = ..., + response: Any | None = ..., + ) -> None: ... + +class LDAPOperationsErrorResult(LDAPOperationResult): ... +class LDAPProtocolErrorResult(LDAPOperationResult): ... +class LDAPTimeLimitExceededResult(LDAPOperationResult): ... +class LDAPSizeLimitExceededResult(LDAPOperationResult): ... +class LDAPAuthMethodNotSupportedResult(LDAPOperationResult): ... +class LDAPStrongerAuthRequiredResult(LDAPOperationResult): ... +class LDAPReferralResult(LDAPOperationResult): ... +class LDAPAdminLimitExceededResult(LDAPOperationResult): ... +class LDAPUnavailableCriticalExtensionResult(LDAPOperationResult): ... +class LDAPConfidentialityRequiredResult(LDAPOperationResult): ... +class LDAPSASLBindInProgressResult(LDAPOperationResult): ... +class LDAPNoSuchAttributeResult(LDAPOperationResult): ... +class LDAPUndefinedAttributeTypeResult(LDAPOperationResult): ... +class LDAPInappropriateMatchingResult(LDAPOperationResult): ... +class LDAPConstraintViolationResult(LDAPOperationResult): ... +class LDAPAttributeOrValueExistsResult(LDAPOperationResult): ... +class LDAPInvalidAttributeSyntaxResult(LDAPOperationResult): ... +class LDAPNoSuchObjectResult(LDAPOperationResult): ... +class LDAPAliasProblemResult(LDAPOperationResult): ... +class LDAPInvalidDNSyntaxResult(LDAPOperationResult): ... +class LDAPAliasDereferencingProblemResult(LDAPOperationResult): ... +class LDAPInappropriateAuthenticationResult(LDAPOperationResult): ... +class LDAPInvalidCredentialsResult(LDAPOperationResult): ... +class LDAPInsufficientAccessRightsResult(LDAPOperationResult): ... +class LDAPBusyResult(LDAPOperationResult): ... +class LDAPUnavailableResult(LDAPOperationResult): ... +class LDAPUnwillingToPerformResult(LDAPOperationResult): ... +class LDAPLoopDetectedResult(LDAPOperationResult): ... +class LDAPNamingViolationResult(LDAPOperationResult): ... +class LDAPObjectClassViolationResult(LDAPOperationResult): ... +class LDAPNotAllowedOnNotLeafResult(LDAPOperationResult): ... +class LDAPNotAllowedOnRDNResult(LDAPOperationResult): ... +class LDAPEntryAlreadyExistsResult(LDAPOperationResult): ... +class LDAPObjectClassModsProhibitedResult(LDAPOperationResult): ... +class LDAPAffectMultipleDSASResult(LDAPOperationResult): ... +class LDAPOtherResult(LDAPOperationResult): ... +class LDAPLCUPResourcesExhaustedResult(LDAPOperationResult): ... +class LDAPLCUPSecurityViolationResult(LDAPOperationResult): ... +class LDAPLCUPInvalidDataResult(LDAPOperationResult): ... +class LDAPLCUPUnsupportedSchemeResult(LDAPOperationResult): ... +class LDAPLCUPReloadRequiredResult(LDAPOperationResult): ... +class LDAPCanceledResult(LDAPOperationResult): ... +class LDAPNoSuchOperationResult(LDAPOperationResult): ... +class LDAPTooLateResult(LDAPOperationResult): ... +class LDAPCannotCancelResult(LDAPOperationResult): ... +class LDAPAssertionFailedResult(LDAPOperationResult): ... +class LDAPAuthorizationDeniedResult(LDAPOperationResult): ... +class LDAPESyncRefreshRequiredResult(LDAPOperationResult): ... + +exception_table: Any + +class LDAPExceptionError(LDAPException): ... +class LDAPConfigurationError(LDAPExceptionError): ... +class LDAPUnknownStrategyError(LDAPConfigurationError): ... +class LDAPUnknownAuthenticationMethodError(LDAPConfigurationError): ... +class LDAPSSLConfigurationError(LDAPConfigurationError): ... +class LDAPDefinitionError(LDAPConfigurationError): ... +class LDAPPackageUnavailableError(LDAPConfigurationError, ImportError): ... +class LDAPConfigurationParameterError(LDAPConfigurationError): ... +class LDAPKeyError(LDAPExceptionError, KeyError, AttributeError): ... +class LDAPObjectError(LDAPExceptionError, ValueError): ... +class LDAPAttributeError(LDAPExceptionError, ValueError, TypeError): ... +class LDAPCursorError(LDAPExceptionError): ... +class LDAPCursorAttributeError(LDAPCursorError, AttributeError): ... +class LDAPObjectDereferenceError(LDAPExceptionError): ... +class LDAPSSLNotSupportedError(LDAPExceptionError, ImportError): ... +class LDAPInvalidTlsSpecificationError(LDAPExceptionError): ... +class LDAPInvalidHashAlgorithmError(LDAPExceptionError, ValueError): ... +class LDAPSignatureVerificationFailedError(LDAPExceptionError): ... +class LDAPBindError(LDAPExceptionError): ... +class LDAPInvalidServerError(LDAPExceptionError): ... +class LDAPSASLMechanismNotSupportedError(LDAPExceptionError): ... +class LDAPConnectionIsReadOnlyError(LDAPExceptionError): ... +class LDAPChangeError(LDAPExceptionError, ValueError): ... +class LDAPServerPoolError(LDAPExceptionError): ... +class LDAPServerPoolExhaustedError(LDAPExceptionError): ... +class LDAPInvalidPortError(LDAPExceptionError): ... +class LDAPStartTLSError(LDAPExceptionError): ... +class LDAPCertificateError(LDAPExceptionError): ... +class LDAPUserNameNotAllowedError(LDAPExceptionError): ... +class LDAPUserNameIsMandatoryError(LDAPExceptionError): ... +class LDAPPasswordIsMandatoryError(LDAPExceptionError): ... +class LDAPInvalidFilterError(LDAPExceptionError): ... +class LDAPInvalidScopeError(LDAPExceptionError, ValueError): ... +class LDAPInvalidDereferenceAliasesError(LDAPExceptionError, ValueError): ... +class LDAPInvalidValueError(LDAPExceptionError, ValueError): ... +class LDAPControlError(LDAPExceptionError, ValueError): ... +class LDAPExtensionError(LDAPExceptionError, ValueError): ... +class LDAPLDIFError(LDAPExceptionError): ... +class LDAPSchemaError(LDAPExceptionError): ... +class LDAPSASLPrepError(LDAPExceptionError): ... +class LDAPSASLBindInProgressError(LDAPExceptionError): ... +class LDAPMetricsError(LDAPExceptionError): ... +class LDAPObjectClassError(LDAPExceptionError): ... +class LDAPInvalidDnError(LDAPExceptionError): ... +class LDAPResponseTimeoutError(LDAPExceptionError): ... +class LDAPTransactionError(LDAPExceptionError): ... +class LDAPInfoError(LDAPExceptionError): ... +class LDAPCommunicationError(LDAPExceptionError): ... +class LDAPSocketOpenError(LDAPCommunicationError): ... +class LDAPSocketCloseError(LDAPCommunicationError): ... +class LDAPSocketReceiveError(LDAPCommunicationError, socket.error): ... +class LDAPSocketSendError(LDAPCommunicationError, socket.error): ... +class LDAPSessionTerminatedByServerError(LDAPCommunicationError): ... +class LDAPUnknownResponseError(LDAPCommunicationError): ... +class LDAPUnknownRequestError(LDAPCommunicationError): ... +class LDAPReferralError(LDAPCommunicationError): ... +class LDAPConnectionPoolNameIsMandatoryError(LDAPExceptionError): ... +class LDAPConnectionPoolNotStartedError(LDAPExceptionError): ... +class LDAPMaximumRetriesError(LDAPExceptionError): ... + +def communication_exception_factory(exc_to_raise, exc): ... +def start_tls_exception_factory(exc): ... diff --git a/stubs/ldap3/ldap3/core/pooling.pyi b/stubs/ldap3/ldap3/core/pooling.pyi new file mode 100644 index 000000000000..088c73e1fb22 --- /dev/null +++ b/stubs/ldap3/ldap3/core/pooling.pyi @@ -0,0 +1,42 @@ +from typing import Any + +POOLING_STRATEGIES: Any + +class ServerState: + server: Any + last_checked_time: Any + available: Any + def __init__(self, server, last_checked_time, available) -> None: ... + +class ServerPoolState: + server_states: Any + strategy: Any + server_pool: Any + last_used_server: int + initialize_time: Any + def __init__(self, server_pool) -> None: ... + def refresh(self) -> None: ... + def get_current_server(self): ... + def get_server(self): ... + def find_active_random_server(self): ... + def find_active_server(self, starting): ... + def __len__(self): ... + +class ServerPool: + servers: Any + pool_states: Any + active: Any + exhaust: Any + single: Any + strategy: Any + def __init__( + self, servers: Any | None = ..., pool_strategy=..., active: bool = ..., exhaust: bool = ..., single_state: bool = ... + ) -> None: ... + def __len__(self): ... + def __getitem__(self, item): ... + def __iter__(self): ... + def add(self, servers) -> None: ... + def remove(self, server) -> None: ... + def initialize(self, connection) -> None: ... + def get_server(self, connection): ... + def get_current_server(self, connection): ... diff --git a/stubs/ldap3/ldap3/core/rdns.pyi b/stubs/ldap3/ldap3/core/rdns.pyi new file mode 100644 index 000000000000..e712f803bcce --- /dev/null +++ b/stubs/ldap3/ldap3/core/rdns.pyi @@ -0,0 +1,12 @@ +from typing import Any + +class ReverseDnsSetting: + OFF: Any + REQUIRE_RESOLVE_ALL_ADDRESSES: Any + REQUIRE_RESOLVE_IP_ADDRESSES_ONLY: Any + OPTIONAL_RESOLVE_ALL_ADDRESSES: Any + OPTIONAL_RESOLVE_IP_ADDRESSES_ONLY: Any + SUPPORTED_VALUES: Any + +def get_hostname_by_addr(addr, success_required: bool = ...): ... +def is_ip_addr(addr): ... diff --git a/stubs/ldap3/ldap3/core/results.pyi b/stubs/ldap3/ldap3/core/results.pyi new file mode 100644 index 000000000000..a2772bd148fe --- /dev/null +++ b/stubs/ldap3/ldap3/core/results.pyi @@ -0,0 +1,56 @@ +from typing import Any + +RESULT_SUCCESS: int +RESULT_OPERATIONS_ERROR: int +RESULT_PROTOCOL_ERROR: int +RESULT_TIME_LIMIT_EXCEEDED: int +RESULT_SIZE_LIMIT_EXCEEDED: int +RESULT_COMPARE_FALSE: int +RESULT_COMPARE_TRUE: int +RESULT_AUTH_METHOD_NOT_SUPPORTED: int +RESULT_STRONGER_AUTH_REQUIRED: int +RESULT_RESERVED: int +RESULT_REFERRAL: int +RESULT_ADMIN_LIMIT_EXCEEDED: int +RESULT_UNAVAILABLE_CRITICAL_EXTENSION: int +RESULT_CONFIDENTIALITY_REQUIRED: int +RESULT_SASL_BIND_IN_PROGRESS: int +RESULT_NO_SUCH_ATTRIBUTE: int +RESULT_UNDEFINED_ATTRIBUTE_TYPE: int +RESULT_INAPPROPRIATE_MATCHING: int +RESULT_CONSTRAINT_VIOLATION: int +RESULT_ATTRIBUTE_OR_VALUE_EXISTS: int +RESULT_INVALID_ATTRIBUTE_SYNTAX: int +RESULT_NO_SUCH_OBJECT: int +RESULT_ALIAS_PROBLEM: int +RESULT_INVALID_DN_SYNTAX: int +RESULT_ALIAS_DEREFERENCING_PROBLEM: int +RESULT_INAPPROPRIATE_AUTHENTICATION: int +RESULT_INVALID_CREDENTIALS: int +RESULT_INSUFFICIENT_ACCESS_RIGHTS: int +RESULT_BUSY: int +RESULT_UNAVAILABLE: int +RESULT_UNWILLING_TO_PERFORM: int +RESULT_LOOP_DETECTED: int +RESULT_NAMING_VIOLATION: int +RESULT_OBJECT_CLASS_VIOLATION: int +RESULT_NOT_ALLOWED_ON_NON_LEAF: int +RESULT_NOT_ALLOWED_ON_RDN: int +RESULT_ENTRY_ALREADY_EXISTS: int +RESULT_OBJECT_CLASS_MODS_PROHIBITED: int +RESULT_AFFECT_MULTIPLE_DSAS: int +RESULT_OTHER: int +RESULT_LCUP_RESOURCES_EXHAUSTED: int +RESULT_LCUP_SECURITY_VIOLATION: int +RESULT_LCUP_INVALID_DATA: int +RESULT_LCUP_UNSUPPORTED_SCHEME: int +RESULT_LCUP_RELOAD_REQUIRED: int +RESULT_CANCELED: int +RESULT_NO_SUCH_OPERATION: int +RESULT_TOO_LATE: int +RESULT_CANNOT_CANCEL: int +RESULT_ASSERTION_FAILED: int +RESULT_AUTHORIZATION_DENIED: int +RESULT_E_SYNC_REFRESH_REQUIRED: int +RESULT_CODES: Any +DO_NOT_RAISE_EXCEPTIONS: Any diff --git a/stubs/ldap3/ldap3/core/server.pyi b/stubs/ldap3/ldap3/core/server.pyi new file mode 100644 index 000000000000..65890428ec7a --- /dev/null +++ b/stubs/ldap3/ldap3/core/server.pyi @@ -0,0 +1,64 @@ +from socket import AF_UNIX as AF_UNIX +from typing import Any +from typing_extensions import Literal + +unix_socket_available: bool + +class Server: + ipc: bool + host: Any + port: Any + allowed_referral_hosts: Any + ssl: Any + tls: Any + name: Any + get_info: Any + dit_lock: Any + custom_formatter: Any + custom_validator: Any + current_address: Any + connect_timeout: Any + mode: Any + def __init__( + self, + host: str, + port: int | None = ..., + use_ssl: bool = ..., + allowed_referral_hosts: Any | None = ..., + get_info: Literal["NO_INFO", "DSA", "SCHEMA", "ALL"] = ..., + tls: Any | None = ..., + formatter: Any | None = ..., + connect_timeout: Any | None = ..., + mode: Literal["IP_SYSTEM_DEFAULT", "IP_V4_ONLY", "IP_V6_ONLY", "IP_V4_PREFERRED", "IP_V6_PREFERRED"] = ..., + validator: Any | None = ..., + ) -> None: ... + @property + def address_info(self): ... + def update_availability(self, address, available) -> None: ... + def reset_availability(self) -> None: ... + def check_availability( + self, source_address: Any | None = ..., source_port: Any | None = ..., source_port_list: Any | None = ... + ): ... + @staticmethod + def next_message_id(): ... + def get_info_from_server(self, connection) -> None: ... + def attach_dsa_info(self, dsa_info: Any | None = ...) -> None: ... + def attach_schema_info(self, dsa_schema: Any | None = ...) -> None: ... + @property + def info(self): ... + @property + def schema(self): ... + @staticmethod + def from_definition( + host, + dsa_info, + dsa_schema, + port: Any | None = ..., + use_ssl: bool = ..., + formatter: Any | None = ..., + validator: Any | None = ..., + ): ... + def candidate_addresses(self): ... + def has_control(self, control): ... + def has_extension(self, extension): ... + def has_feature(self, feature): ... diff --git a/stubs/ldap3/ldap3/core/timezone.pyi b/stubs/ldap3/ldap3/core/timezone.pyi new file mode 100644 index 000000000000..c6c52b37c0ae --- /dev/null +++ b/stubs/ldap3/ldap3/core/timezone.pyi @@ -0,0 +1,11 @@ +from datetime import tzinfo +from typing import Any + +class OffsetTzInfo(tzinfo): + offset: Any + name: Any + def __init__(self, offset, name) -> None: ... + def utcoffset(self, dt): ... + def tzname(self, dt): ... + def dst(self, dt): ... + def __getinitargs__(self): ... diff --git a/stubs/ldap3/ldap3/core/tls.pyi b/stubs/ldap3/ldap3/core/tls.pyi new file mode 100644 index 000000000000..c776f7f88ad5 --- /dev/null +++ b/stubs/ldap3/ldap3/core/tls.pyi @@ -0,0 +1,36 @@ +from typing import Any + +use_ssl_context: bool + +class Tls: + ssl_options: Any + validate: Any + ca_certs_file: Any + ca_certs_path: Any + ca_certs_data: Any + private_key_password: Any + version: Any + private_key_file: Any + certificate_file: Any + valid_names: Any + ciphers: Any + sni: Any + def __init__( + self, + local_private_key_file: Any | None = ..., + local_certificate_file: Any | None = ..., + validate=..., + version: Any | None = ..., + ssl_options: Any | None = ..., + ca_certs_file: Any | None = ..., + valid_names: Any | None = ..., + ca_certs_path: Any | None = ..., + ca_certs_data: Any | None = ..., + local_private_key_password: Any | None = ..., + ciphers: Any | None = ..., + sni: Any | None = ..., + ) -> None: ... + def wrap_socket(self, connection, do_handshake: bool = ...) -> None: ... + def start_tls(self, connection): ... + +def check_hostname(sock, server_name, additional_names) -> None: ... diff --git a/stubs/ldap3/ldap3/core/usage.pyi b/stubs/ldap3/ldap3/core/usage.pyi new file mode 100644 index 000000000000..ccb805bbde76 --- /dev/null +++ b/stubs/ldap3/ldap3/core/usage.pyi @@ -0,0 +1,41 @@ +from typing import Any + +class ConnectionUsage: + open_sockets: int + closed_sockets: int + wrapped_sockets: int + bytes_transmitted: int + bytes_received: int + messages_transmitted: int + messages_received: int + operations: int + abandon_operations: int + add_operations: int + bind_operations: int + compare_operations: int + delete_operations: int + extended_operations: int + modify_operations: int + modify_dn_operations: int + search_operations: int + unbind_operations: int + referrals_received: int + referrals_followed: int + referrals_connections: int + restartable_failures: int + restartable_successes: int + servers_from_pool: int + def reset(self) -> None: ... + initial_connection_start_time: Any + open_socket_start_time: Any + connection_stop_time: Any + last_transmitted_time: Any + last_received_time: Any + def __init__(self) -> None: ... + def __iadd__(self, other): ... + def update_transmitted_message(self, message, length) -> None: ... + def update_received_message(self, length) -> None: ... + def start(self, reset: bool = ...) -> None: ... + def stop(self) -> None: ... + @property + def elapsed_time(self): ... diff --git a/stubs/ldap3/ldap3/extend/__init__.pyi b/stubs/ldap3/ldap3/extend/__init__.pyi new file mode 100644 index 000000000000..61ca6f486b45 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/__init__.pyi @@ -0,0 +1,105 @@ +from typing import Any + +class ExtendedOperationContainer: + def __init__(self, connection) -> None: ... + +class StandardExtendedOperations(ExtendedOperationContainer): + def who_am_i(self, controls: Any | None = ...): ... + def modify_password( + self, + user: Any | None = ..., + old_password: Any | None = ..., + new_password: Any | None = ..., + hash_algorithm: Any | None = ..., + salt: Any | None = ..., + controls: Any | None = ..., + ): ... + def paged_search( + self, + search_base, + search_filter, + search_scope=..., + dereference_aliases=..., + attributes: Any | None = ..., + size_limit: int = ..., + time_limit: int = ..., + types_only: bool = ..., + get_operational_attributes: bool = ..., + controls: Any | None = ..., + paged_size: int = ..., + paged_criticality: bool = ..., + generator: bool = ..., + ): ... + def persistent_search( + self, + search_base: str = ..., + search_filter: str = ..., + search_scope=..., + dereference_aliases=..., + attributes=..., + size_limit: int = ..., + time_limit: int = ..., + controls: Any | None = ..., + changes_only: bool = ..., + show_additions: bool = ..., + show_deletions: bool = ..., + show_modifications: bool = ..., + show_dn_modifications: bool = ..., + notifications: bool = ..., + streaming: bool = ..., + callback: Any | None = ..., + ): ... + def funnel_search( + self, + search_base: str = ..., + search_filter: str = ..., + search_scope=..., + dereference_aliases=..., + attributes=..., + size_limit: int = ..., + time_limit: int = ..., + controls: Any | None = ..., + streaming: bool = ..., + callback: Any | None = ..., + ): ... + +class NovellExtendedOperations(ExtendedOperationContainer): + def get_bind_dn(self, controls: Any | None = ...): ... + def get_universal_password(self, user, controls: Any | None = ...): ... + def set_universal_password(self, user, new_password: Any | None = ..., controls: Any | None = ...): ... + def list_replicas(self, server_dn, controls: Any | None = ...): ... + def partition_entry_count(self, partition_dn, controls: Any | None = ...): ... + def replica_info(self, server_dn, partition_dn, controls: Any | None = ...): ... + def start_transaction(self, controls: Any | None = ...): ... + def end_transaction(self, commit: bool = ..., controls: Any | None = ...): ... + def add_members_to_groups(self, members, groups, fix: bool = ..., transaction: bool = ...): ... + def remove_members_from_groups(self, members, groups, fix: bool = ..., transaction: bool = ...): ... + def check_groups_memberships(self, members, groups, fix: bool = ..., transaction: bool = ...): ... + +class MicrosoftExtendedOperations(ExtendedOperationContainer): + def dir_sync( + self, + sync_base, + sync_filter: str = ..., + attributes=..., + cookie: Any | None = ..., + object_security: bool = ..., + ancestors_first: bool = ..., + public_data_only: bool = ..., + incremental_values: bool = ..., + max_length: int = ..., + hex_guid: bool = ..., + ): ... + def modify_password(self, user, new_password, old_password: Any | None = ..., controls: Any | None = ...): ... + def unlock_account(self, user): ... + def add_members_to_groups(self, members, groups, fix: bool = ...): ... + def remove_members_from_groups(self, members, groups, fix: bool = ...): ... + def persistent_search( + self, search_base: str = ..., search_scope=..., attributes=..., streaming: bool = ..., callback: Any | None = ... + ): ... + +class ExtendedOperationsRoot(ExtendedOperationContainer): + standard: Any + novell: Any + microsoft: Any + def __init__(self, connection) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/microsoft/__init__.pyi b/stubs/ldap3/ldap3/extend/microsoft/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/ldap3/ldap3/extend/microsoft/addMembersToGroups.pyi b/stubs/ldap3/ldap3/extend/microsoft/addMembersToGroups.pyi new file mode 100644 index 000000000000..486d084f95ec --- /dev/null +++ b/stubs/ldap3/ldap3/extend/microsoft/addMembersToGroups.pyi @@ -0,0 +1 @@ +def ad_add_members_to_groups(connection, members_dn, groups_dn, fix: bool = ..., raise_error: bool = ...): ... diff --git a/stubs/ldap3/ldap3/extend/microsoft/dirSync.pyi b/stubs/ldap3/ldap3/extend/microsoft/dirSync.pyi new file mode 100644 index 000000000000..68acbfc5d21e --- /dev/null +++ b/stubs/ldap3/ldap3/extend/microsoft/dirSync.pyi @@ -0,0 +1,30 @@ +from typing import Any + +class DirSync: + connection: Any + base: Any + filter: Any + attributes: Any + cookie: Any + object_security: Any + ancestors_first: Any + public_data_only: Any + incremental_values: Any + max_length: Any + hex_guid: Any + more_results: bool + def __init__( + self, + connection, + sync_base, + sync_filter, + attributes, + cookie, + object_security, + ancestors_first, + public_data_only, + incremental_values, + max_length, + hex_guid, + ) -> None: ... + def loop(self): ... diff --git a/stubs/ldap3/ldap3/extend/microsoft/modifyPassword.pyi b/stubs/ldap3/ldap3/extend/microsoft/modifyPassword.pyi new file mode 100644 index 000000000000..5b3d27a0f751 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/microsoft/modifyPassword.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def ad_modify_password(connection, user_dn, new_password, old_password, controls: Any | None = ...): ... diff --git a/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi b/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi new file mode 100644 index 000000000000..95fca82fce4b --- /dev/null +++ b/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi @@ -0,0 +1,15 @@ +from typing import Any + +class ADPersistentSearch: + connection: Any + message_id: Any + base: Any + scope: Any + attributes: Any + controls: Any + filter: str + def __init__(self, connection, search_base, search_scope, attributes, streaming, callback) -> None: ... + def start(self) -> None: ... + def stop(self, unbind: bool = ...) -> None: ... + def next(self, block: bool = ..., timeout: Any | None = ...): ... + def funnel(self, block: bool = ..., timeout: Any | None = ...) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/microsoft/removeMembersFromGroups.pyi b/stubs/ldap3/ldap3/extend/microsoft/removeMembersFromGroups.pyi new file mode 100644 index 000000000000..915fb9dbb562 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/microsoft/removeMembersFromGroups.pyi @@ -0,0 +1 @@ +def ad_remove_members_from_groups(connection, members_dn, groups_dn, fix, raise_error: bool = ...): ... diff --git a/stubs/ldap3/ldap3/extend/microsoft/unlockAccount.pyi b/stubs/ldap3/ldap3/extend/microsoft/unlockAccount.pyi new file mode 100644 index 000000000000..842378089f63 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/microsoft/unlockAccount.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def ad_unlock_account(connection, user_dn, controls: Any | None = ...): ... diff --git a/stubs/ldap3/ldap3/extend/novell/__init__.pyi b/stubs/ldap3/ldap3/extend/novell/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/ldap3/ldap3/extend/novell/addMembersToGroups.pyi b/stubs/ldap3/ldap3/extend/novell/addMembersToGroups.pyi new file mode 100644 index 000000000000..5ba4cab9b309 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/novell/addMembersToGroups.pyi @@ -0,0 +1 @@ +def edir_add_members_to_groups(connection, members_dn, groups_dn, fix, transaction): ... diff --git a/stubs/ldap3/ldap3/extend/novell/checkGroupsMemberships.pyi b/stubs/ldap3/ldap3/extend/novell/checkGroupsMemberships.pyi new file mode 100644 index 000000000000..551636c2904f --- /dev/null +++ b/stubs/ldap3/ldap3/extend/novell/checkGroupsMemberships.pyi @@ -0,0 +1 @@ +def edir_check_groups_memberships(connection, members_dn, groups_dn, fix, transaction): ... diff --git a/stubs/ldap3/ldap3/extend/novell/endTransaction.pyi b/stubs/ldap3/ldap3/extend/novell/endTransaction.pyi new file mode 100644 index 000000000000..f0e8c5896949 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/novell/endTransaction.pyi @@ -0,0 +1,14 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class EndTransaction(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + asn1_spec: Any + def config(self) -> None: ... + def __init__(self, connection, commit: bool = ..., controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... + response_value: Any + def set_response(self) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/novell/getBindDn.pyi b/stubs/ldap3/ldap3/extend/novell/getBindDn.pyi new file mode 100644 index 000000000000..4c194ce82909 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/novell/getBindDn.pyi @@ -0,0 +1,11 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class GetBindDn(ExtendedOperation): + request_name: str + response_name: str + response_attribute: str + asn1_spec: Any + def config(self) -> None: ... + def populate_result(self) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/novell/listReplicas.pyi b/stubs/ldap3/ldap3/extend/novell/listReplicas.pyi new file mode 100644 index 000000000000..0c7b6e7a80af --- /dev/null +++ b/stubs/ldap3/ldap3/extend/novell/listReplicas.pyi @@ -0,0 +1,13 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class ListReplicas(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + asn1_spec: Any + response_attribute: str + def config(self) -> None: ... + def __init__(self, connection, server_dn, controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/novell/nmasGetUniversalPassword.pyi b/stubs/ldap3/ldap3/extend/novell/nmasGetUniversalPassword.pyi new file mode 100644 index 000000000000..59d0f1ca37ac --- /dev/null +++ b/stubs/ldap3/ldap3/extend/novell/nmasGetUniversalPassword.pyi @@ -0,0 +1,13 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class NmasGetUniversalPassword(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + asn1_spec: Any + response_attribute: str + def config(self) -> None: ... + def __init__(self, connection, user, controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/novell/nmasSetUniversalPassword.pyi b/stubs/ldap3/ldap3/extend/novell/nmasSetUniversalPassword.pyi new file mode 100644 index 000000000000..a35b984ba8f2 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/novell/nmasSetUniversalPassword.pyi @@ -0,0 +1,13 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class NmasSetUniversalPassword(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + asn1_spec: Any + response_attribute: str + def config(self) -> None: ... + def __init__(self, connection, user, new_password, controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/novell/partition_entry_count.pyi b/stubs/ldap3/ldap3/extend/novell/partition_entry_count.pyi new file mode 100644 index 000000000000..a9127983afcf --- /dev/null +++ b/stubs/ldap3/ldap3/extend/novell/partition_entry_count.pyi @@ -0,0 +1,12 @@ +from typing import Any + +from ..operation import ExtendedOperation + +class PartitionEntryCount(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + response_attribute: str + def config(self) -> None: ... + def __init__(self, connection, partition_dn, controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/novell/removeMembersFromGroups.pyi b/stubs/ldap3/ldap3/extend/novell/removeMembersFromGroups.pyi new file mode 100644 index 000000000000..91a3223c52eb --- /dev/null +++ b/stubs/ldap3/ldap3/extend/novell/removeMembersFromGroups.pyi @@ -0,0 +1 @@ +def edir_remove_members_from_groups(connection, members_dn, groups_dn, fix, transaction): ... diff --git a/stubs/ldap3/ldap3/extend/novell/replicaInfo.pyi b/stubs/ldap3/ldap3/extend/novell/replicaInfo.pyi new file mode 100644 index 000000000000..6a4358053f43 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/novell/replicaInfo.pyi @@ -0,0 +1,12 @@ +from typing import Any + +from ..operation import ExtendedOperation + +class ReplicaInfo(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + response_attribute: str + def config(self) -> None: ... + def __init__(self, connection, server_dn, partition_dn, controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/novell/startTransaction.pyi b/stubs/ldap3/ldap3/extend/novell/startTransaction.pyi new file mode 100644 index 000000000000..74dd78c5cf06 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/novell/startTransaction.pyi @@ -0,0 +1,14 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class StartTransaction(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + asn1_spec: Any + def config(self) -> None: ... + def __init__(self, connection, controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... + response_value: Any + def set_response(self) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/operation.pyi b/stubs/ldap3/ldap3/extend/operation.pyi new file mode 100644 index 000000000000..4b14b4b5333d --- /dev/null +++ b/stubs/ldap3/ldap3/extend/operation.pyi @@ -0,0 +1,19 @@ +from typing import Any + +class ExtendedOperation: + connection: Any + decoded_response: Any + result: Any + asn1_spec: Any + request_name: Any + response_name: Any + request_value: Any + response_value: Any + response_attribute: Any + controls: Any + def __init__(self, connection, controls: Any | None = ...) -> None: ... + def send(self): ... + def populate_result(self) -> None: ... + def decode_response(self, response: Any | None = ...) -> None: ... + def set_response(self) -> None: ... + def config(self) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/standard/PagedSearch.pyi b/stubs/ldap3/ldap3/extend/standard/PagedSearch.pyi new file mode 100644 index 000000000000..741f7c5b96c5 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/standard/PagedSearch.pyi @@ -0,0 +1,32 @@ +from typing import Any + +def paged_search_generator( + connection, + search_base, + search_filter, + search_scope=..., + dereference_aliases=..., + attributes: Any | None = ..., + size_limit: int = ..., + time_limit: int = ..., + types_only: bool = ..., + get_operational_attributes: bool = ..., + controls: Any | None = ..., + paged_size: int = ..., + paged_criticality: bool = ..., +) -> None: ... +def paged_search_accumulator( + connection, + search_base, + search_filter, + search_scope=..., + dereference_aliases=..., + attributes: Any | None = ..., + size_limit: int = ..., + time_limit: int = ..., + types_only: bool = ..., + get_operational_attributes: bool = ..., + controls: Any | None = ..., + paged_size: int = ..., + paged_criticality: bool = ..., +): ... diff --git a/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi b/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi new file mode 100644 index 000000000000..3af402ec3654 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi @@ -0,0 +1,36 @@ +from typing import Any + +class PersistentSearch: + connection: Any + changes_only: Any + notifications: Any + message_id: Any + base: Any + filter: Any + scope: Any + dereference_aliases: Any + attributes: Any + size_limit: Any + time_limit: Any + controls: Any + def __init__( + self, + connection, + search_base, + search_filter, + search_scope, + dereference_aliases, + attributes, + size_limit, + time_limit, + controls, + changes_only, + events_type, + notifications, + streaming, + callback, + ) -> None: ... + def start(self) -> None: ... + def stop(self, unbind: bool = ...) -> None: ... + def next(self, block: bool = ..., timeout: Any | None = ...): ... + def funnel(self, block: bool = ..., timeout: Any | None = ...) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/standard/__init__.pyi b/stubs/ldap3/ldap3/extend/standard/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/ldap3/ldap3/extend/standard/modifyPassword.pyi b/stubs/ldap3/ldap3/extend/standard/modifyPassword.pyi new file mode 100644 index 000000000000..5df4b6d1ecbd --- /dev/null +++ b/stubs/ldap3/ldap3/extend/standard/modifyPassword.pyi @@ -0,0 +1,21 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class ModifyPassword(ExtendedOperation): + request_name: str + request_value: Any + asn1_spec: Any + response_attribute: str + def config(self) -> None: ... + def __init__( + self, + connection, + user: Any | None = ..., + old_password: Any | None = ..., + new_password: Any | None = ..., + hash_algorithm: Any | None = ..., + salt: Any | None = ..., + controls: Any | None = ..., + ) -> None: ... + def populate_result(self) -> None: ... diff --git a/stubs/ldap3/ldap3/extend/standard/whoAmI.pyi b/stubs/ldap3/ldap3/extend/standard/whoAmI.pyi new file mode 100644 index 000000000000..e61b175e92c9 --- /dev/null +++ b/stubs/ldap3/ldap3/extend/standard/whoAmI.pyi @@ -0,0 +1,7 @@ +from ...extend.operation import ExtendedOperation + +class WhoAmI(ExtendedOperation): + request_name: str + response_attribute: str + def config(self) -> None: ... + def populate_result(self) -> None: ... diff --git a/stubs/ldap3/ldap3/operation/__init__.pyi b/stubs/ldap3/ldap3/operation/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/ldap3/ldap3/operation/abandon.pyi b/stubs/ldap3/ldap3/operation/abandon.pyi new file mode 100644 index 000000000000..2413c214cdc1 --- /dev/null +++ b/stubs/ldap3/ldap3/operation/abandon.pyi @@ -0,0 +1,2 @@ +def abandon_operation(msg_id): ... +def abandon_request_to_dict(request): ... diff --git a/stubs/ldap3/ldap3/operation/add.pyi b/stubs/ldap3/ldap3/operation/add.pyi new file mode 100644 index 000000000000..59d87bae8a03 --- /dev/null +++ b/stubs/ldap3/ldap3/operation/add.pyi @@ -0,0 +1,7 @@ +from typing import Any + +def add_operation( + dn, attributes, auto_encode, schema: Any | None = ..., validator: Any | None = ..., check_names: bool = ... +): ... +def add_request_to_dict(request): ... +def add_response_to_dict(response): ... diff --git a/stubs/ldap3/ldap3/operation/bind.pyi b/stubs/ldap3/ldap3/operation/bind.pyi new file mode 100644 index 000000000000..5079a87da77d --- /dev/null +++ b/stubs/ldap3/ldap3/operation/bind.pyi @@ -0,0 +1,23 @@ +from typing import Any + +def bind_operation( + version, + authentication, + name: str = ..., + password: Any | None = ..., + sasl_mechanism: Any | None = ..., + sasl_credentials: Any | None = ..., + auto_encode: bool = ..., +): ... +def bind_request_to_dict(request): ... +def bind_response_operation( + result_code, + matched_dn: str = ..., + diagnostic_message: str = ..., + referral: Any | None = ..., + server_sasl_credentials: Any | None = ..., +): ... +def bind_response_to_dict(response): ... +def sicily_bind_response_to_dict(response): ... +def bind_response_to_dict_fast(response): ... +def sicily_bind_response_to_dict_fast(response): ... diff --git a/stubs/ldap3/ldap3/operation/compare.pyi b/stubs/ldap3/ldap3/operation/compare.pyi new file mode 100644 index 000000000000..4b12d354700d --- /dev/null +++ b/stubs/ldap3/ldap3/operation/compare.pyi @@ -0,0 +1,7 @@ +from typing import Any + +def compare_operation( + dn, attribute, value, auto_encode, schema: Any | None = ..., validator: Any | None = ..., check_names: bool = ... +): ... +def compare_request_to_dict(request): ... +def compare_response_to_dict(response): ... diff --git a/stubs/ldap3/ldap3/operation/delete.pyi b/stubs/ldap3/ldap3/operation/delete.pyi new file mode 100644 index 000000000000..618c8f41c96a --- /dev/null +++ b/stubs/ldap3/ldap3/operation/delete.pyi @@ -0,0 +1,3 @@ +def delete_operation(dn): ... +def delete_request_to_dict(request): ... +def delete_response_to_dict(response): ... diff --git a/stubs/ldap3/ldap3/operation/extended.pyi b/stubs/ldap3/ldap3/operation/extended.pyi new file mode 100644 index 000000000000..2cc46be69181 --- /dev/null +++ b/stubs/ldap3/ldap3/operation/extended.pyi @@ -0,0 +1,8 @@ +from typing import Any + +def extended_operation(request_name, request_value: Any | None = ..., no_encode: Any | None = ...): ... +def extended_request_to_dict(request): ... +def extended_response_to_dict(response): ... +def intermediate_response_to_dict(response): ... +def extended_response_to_dict_fast(response): ... +def intermediate_response_to_dict_fast(response): ... diff --git a/stubs/ldap3/ldap3/operation/modify.pyi b/stubs/ldap3/ldap3/operation/modify.pyi new file mode 100644 index 000000000000..8700499b9e94 --- /dev/null +++ b/stubs/ldap3/ldap3/operation/modify.pyi @@ -0,0 +1,9 @@ +from typing import Any + +change_table: Any + +def modify_operation( + dn, changes, auto_encode, schema: Any | None = ..., validator: Any | None = ..., check_names: bool = ... +): ... +def modify_request_to_dict(request): ... +def modify_response_to_dict(response): ... diff --git a/stubs/ldap3/ldap3/operation/modifyDn.pyi b/stubs/ldap3/ldap3/operation/modifyDn.pyi new file mode 100644 index 000000000000..db754b8fa4ca --- /dev/null +++ b/stubs/ldap3/ldap3/operation/modifyDn.pyi @@ -0,0 +1,5 @@ +from typing import Any + +def modify_dn_operation(dn, new_relative_dn, delete_old_rdn: bool = ..., new_superior: Any | None = ...): ... +def modify_dn_request_to_dict(request): ... +def modify_dn_response_to_dict(response): ... diff --git a/stubs/ldap3/ldap3/operation/search.pyi b/stubs/ldap3/ldap3/operation/search.pyi new file mode 100644 index 000000000000..78a728ed439e --- /dev/null +++ b/stubs/ldap3/ldap3/operation/search.pyi @@ -0,0 +1,63 @@ +from typing import Any + +ROOT: int +AND: int +OR: int +NOT: int +MATCH_APPROX: int +MATCH_GREATER_OR_EQUAL: int +MATCH_LESS_OR_EQUAL: int +MATCH_EXTENSIBLE: int +MATCH_PRESENT: int +MATCH_SUBSTRING: int +MATCH_EQUAL: int +SEARCH_OPEN: int +SEARCH_OPEN_OR_CLOSE: int +SEARCH_MATCH_OR_CLOSE: int +SEARCH_MATCH_OR_CONTROL: int + +class FilterNode: + tag: Any + parent: Any + assertion: Any + elements: Any + def __init__(self, tag: Any | None = ..., assertion: Any | None = ...) -> None: ... + def append(self, filter_node): ... + +def evaluate_match(match, schema, auto_escape, auto_encode, validator, check_names): ... +def parse_filter(search_filter, schema, auto_escape, auto_encode, validator, check_names): ... +def compile_filter(filter_node): ... +def build_attribute_selection(attribute_list, schema): ... +def search_operation( + search_base, + search_filter, + search_scope, + dereference_aliases, + attributes, + size_limit, + time_limit, + types_only, + auto_escape, + auto_encode, + schema: Any | None = ..., + validator: Any | None = ..., + check_names: bool = ..., +): ... +def decode_vals(vals): ... +def decode_vals_fast(vals): ... +def attributes_to_dict(attribute_list): ... +def attributes_to_dict_fast(attribute_list): ... +def decode_raw_vals(vals): ... +def decode_raw_vals_fast(vals): ... +def raw_attributes_to_dict(attribute_list): ... +def raw_attributes_to_dict_fast(attribute_list): ... +def checked_attributes_to_dict(attribute_list, schema: Any | None = ..., custom_formatter: Any | None = ...): ... +def checked_attributes_to_dict_fast(attribute_list, schema: Any | None = ..., custom_formatter: Any | None = ...): ... +def matching_rule_assertion_to_string(matching_rule_assertion): ... +def filter_to_string(filter_object): ... +def search_request_to_dict(request): ... +def search_result_entry_response_to_dict(response, schema, custom_formatter, check_names): ... +def search_result_done_response_to_dict(response): ... +def search_result_reference_response_to_dict(response): ... +def search_result_entry_response_to_dict_fast(response, schema, custom_formatter, check_names): ... +def search_result_reference_response_to_dict_fast(response): ... diff --git a/stubs/ldap3/ldap3/operation/unbind.pyi b/stubs/ldap3/ldap3/operation/unbind.pyi new file mode 100644 index 000000000000..0c66a79d615c --- /dev/null +++ b/stubs/ldap3/ldap3/operation/unbind.pyi @@ -0,0 +1 @@ +def unbind_operation(): ... diff --git a/stubs/ldap3/ldap3/protocol/__init__.pyi b/stubs/ldap3/ldap3/protocol/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/ldap3/ldap3/protocol/controls.pyi b/stubs/ldap3/ldap3/protocol/controls.pyi new file mode 100644 index 000000000000..7c67b9f3c104 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/controls.pyi @@ -0,0 +1 @@ +def build_control(oid, criticality, value, encode_control_value: bool = ...): ... diff --git a/stubs/ldap3/ldap3/protocol/convert.pyi b/stubs/ldap3/ldap3/protocol/convert.pyi new file mode 100644 index 000000000000..4bf4baf99b3b --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/convert.pyi @@ -0,0 +1,22 @@ +from typing import Any + +def to_str_or_normalized_unicode(val): ... +def attribute_to_dict(attribute): ... +def attributes_to_dict(attributes): ... +def referrals_to_list(referrals): ... +def search_refs_to_list(search_refs): ... +def search_refs_to_list_fast(search_refs): ... +def sasl_to_dict(sasl): ... +def authentication_choice_to_dict(authentication_choice): ... +def partial_attribute_to_dict(modification): ... +def change_to_dict(change): ... +def changes_to_list(changes): ... +def attributes_to_list(attributes): ... +def ava_to_dict(ava): ... +def substring_to_dict(substring): ... +def prepare_changes_for_request(changes): ... +def build_controls_list(controls): ... +def validate_assertion_value(schema, name, value, auto_escape, auto_encode, validator, check_names): ... +def validate_attribute_value(schema, name, value, auto_encode, validator: Any | None = ..., check_names: bool = ...): ... +def prepare_filter_for_sending(raw_string): ... +def prepare_for_sending(raw_string): ... diff --git a/stubs/ldap3/ldap3/protocol/formatters/__init__.pyi b/stubs/ldap3/ldap3/protocol/formatters/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/ldap3/ldap3/protocol/formatters/formatters.pyi b/stubs/ldap3/ldap3/protocol/formatters/formatters.pyi new file mode 100644 index 000000000000..69c4e1aea172 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/formatters/formatters.pyi @@ -0,0 +1,16 @@ +from typing import Any + +def format_unicode(raw_value): ... +def format_integer(raw_value): ... +def format_binary(raw_value): ... +def format_uuid(raw_value): ... +def format_uuid_le(raw_value): ... +def format_boolean(raw_value): ... +def format_ad_timestamp(raw_value): ... + +time_format: Any + +def format_time(raw_value): ... +def format_ad_timedelta(raw_value): ... +def format_time_with_0_year(raw_value): ... +def format_sid(raw_value): ... diff --git a/stubs/ldap3/ldap3/protocol/formatters/standard.pyi b/stubs/ldap3/ldap3/protocol/formatters/standard.pyi new file mode 100644 index 000000000000..f85dd6485adf --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/formatters/standard.pyi @@ -0,0 +1,7 @@ +from typing import Any + +standard_formatter: Any + +def find_attribute_helpers(attr_type, name, custom_formatter): ... +def format_attribute_values(schema, name, values, custom_formatter): ... +def find_attribute_validator(schema, name, custom_validator): ... diff --git a/stubs/ldap3/ldap3/protocol/formatters/validators.pyi b/stubs/ldap3/ldap3/protocol/formatters/validators.pyi new file mode 100644 index 000000000000..b49eee6262d2 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/formatters/validators.pyi @@ -0,0 +1,16 @@ +def check_backslash(value): ... +def check_type(input_value, value_type): ... +def always_valid(input_value): ... +def validate_generic_single_value(input_value): ... +def validate_zero_and_minus_one_and_positive_int(input_value): ... +def validate_integer(input_value): ... +def validate_bytes(input_value): ... +def validate_boolean(input_value): ... +def validate_time_with_0_year(input_value): ... +def validate_time(input_value): ... +def validate_ad_timestamp(input_value): ... +def validate_ad_timedelta(input_value): ... +def validate_guid(input_value): ... +def validate_uuid(input_value): ... +def validate_uuid_le(input_value): ... +def validate_sid(input_value): ... diff --git a/stubs/ldap3/ldap3/protocol/microsoft.pyi b/stubs/ldap3/ldap3/protocol/microsoft.pyi new file mode 100644 index 000000000000..204a718e333d --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/microsoft.pyi @@ -0,0 +1,27 @@ +from typing import Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.type.univ import Sequence +Sequence = Any + +class SicilyBindResponse(Sequence): + tagSet: Any + componentType: Any + +class DirSyncControlRequestValue(Sequence): + componentType: Any + +class DirSyncControlResponseValue(Sequence): + componentType: Any + +class SdFlags(Sequence): + componentType: Any + +class ExtendedDN(Sequence): + componentType: Any + +def dir_sync_control(criticality, object_security, ancestors_first, public_data_only, incremental_values, max_length, cookie): ... +def extended_dn_control(criticality: bool = ..., hex_format: bool = ...): ... +def show_deleted_control(criticality: bool = ...): ... +def security_descriptor_control(criticality: bool = ..., sdflags: int = ...): ... +def persistent_search_control(criticality: bool = ...): ... diff --git a/stubs/ldap3/ldap3/protocol/novell.pyi b/stubs/ldap3/ldap3/protocol/novell.pyi new file mode 100644 index 000000000000..8ced7089e996 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/novell.pyi @@ -0,0 +1,72 @@ +from typing import Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.type.univ import Integer, OctetString, Sequence, SequenceOf +Integer = Any +OctetString = Any +Sequence = Any +SequenceOf = Any + +NMAS_LDAP_EXT_VERSION: int + +class Identity(OctetString): + encoding: str + +class LDAPDN(OctetString): + tagSet: Any + encoding: str + +class Password(OctetString): + tagSet: Any + encoding: str + +class LDAPOID(OctetString): + tagSet: Any + encoding: str + +class GroupCookie(Integer): + tagSet: Any + +class NmasVer(Integer): + tagSet: Any + +class Error(Integer): + tagSet: Any + +class NmasGetUniversalPasswordRequestValue(Sequence): + componentType: Any + +class NmasGetUniversalPasswordResponseValue(Sequence): + componentType: Any + +class NmasSetUniversalPasswordRequestValue(Sequence): + componentType: Any + +class NmasSetUniversalPasswordResponseValue(Sequence): + componentType: Any + +class ReplicaList(SequenceOf): + componentType: Any + +class ReplicaInfoRequestValue(Sequence): + tagSet: Any + componentType: Any + +class ReplicaInfoResponseValue(Sequence): + tagSet: Any + componentType: Any + +class CreateGroupTypeRequestValue(Sequence): + componentType: Any + +class CreateGroupTypeResponseValue(Sequence): + componentType: Any + +class EndGroupTypeRequestValue(Sequence): + componentType: Any + +class EndGroupTypeResponseValue(Sequence): + componentType: Any + +class GroupingControlValue(Sequence): + componentType: Any diff --git a/stubs/ldap3/ldap3/protocol/oid.pyi b/stubs/ldap3/ldap3/protocol/oid.pyi new file mode 100644 index 000000000000..77efddad270f --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/oid.pyi @@ -0,0 +1,29 @@ +from typing import Any + +OID_CONTROL: str +OID_EXTENSION: str +OID_FEATURE: str +OID_UNSOLICITED_NOTICE: str +OID_ATTRIBUTE_TYPE: str +OID_DIT_CONTENT_RULE: str +OID_LDAP_URL_EXTENSION: str +OID_FAMILY: str +OID_MATCHING_RULE: str +OID_NAME_FORM: str +OID_OBJECT_CLASS: str +OID_ADMINISTRATIVE_ROLE: str +OID_LDAP_SYNTAX: str +CLASS_STRUCTURAL: str +CLASS_ABSTRACT: str +CLASS_AUXILIARY: str +ATTRIBUTE_USER_APPLICATION: str +ATTRIBUTE_DIRECTORY_OPERATION: str +ATTRIBUTE_DISTRIBUTED_OPERATION: str +ATTRIBUTE_DSA_OPERATION: str + +def constant_to_oid_kind(oid_kind): ... +def decode_oids(sequence): ... +def decode_syntax(syntax): ... +def oid_to_string(oid): ... + +Oids: Any diff --git a/stubs/ldap3/ldap3/protocol/persistentSearch.pyi b/stubs/ldap3/ldap3/protocol/persistentSearch.pyi new file mode 100644 index 000000000000..933ae390b28c --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/persistentSearch.pyi @@ -0,0 +1,17 @@ +from typing import Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.type.univ import Enumerated, Sequence +Enumerated = Any +Sequence = Any + +class PersistentSearchControl(Sequence): + componentType: Any + +class ChangeType(Enumerated): + namedValues: Any + +class EntryChangeNotificationControl(Sequence): + componentType: Any + +def persistent_search_control(change_types, changes_only: bool = ..., return_ecs: bool = ..., criticality: bool = ...): ... diff --git a/stubs/ldap3/ldap3/protocol/rfc2696.pyi b/stubs/ldap3/ldap3/protocol/rfc2696.pyi new file mode 100644 index 000000000000..8cb346f0304b --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/rfc2696.pyi @@ -0,0 +1,21 @@ +from typing import Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.type.univ import Integer, OctetString, Sequence +Integer = Any +OctetString = Any +Sequence = Any + +MAXINT: Any +rangeInt0ToMaxConstraint: Any + +class Integer0ToMax(Integer): + subtypeSpec: Any + +class Size(Integer0ToMax): ... +class Cookie(OctetString): ... + +class RealSearchControlValue(Sequence): + componentType: Any + +def paged_search_control(criticality: bool = ..., size: int = ..., cookie: Any | None = ...): ... diff --git a/stubs/ldap3/ldap3/protocol/rfc2849.pyi b/stubs/ldap3/ldap3/protocol/rfc2849.pyi new file mode 100644 index 000000000000..b589bc57ce65 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/rfc2849.pyi @@ -0,0 +1,18 @@ +from typing import Any + +conf_ldif_line_length: Any + +def safe_ldif_string(bytes_value): ... +def add_controls(controls, all_base64): ... +def add_attributes(attributes, all_base64): ... +def sort_ldif_lines(lines, sort_order): ... +def search_response_to_ldif(entries, all_base64, sort_order: Any | None = ...): ... +def add_request_to_ldif(entry, all_base64, sort_order: Any | None = ...): ... +def delete_request_to_ldif(entry, all_base64, sort_order: Any | None = ...): ... +def modify_request_to_ldif(entry, all_base64, sort_order: Any | None = ...): ... +def modify_dn_request_to_ldif(entry, all_base64, sort_order: Any | None = ...): ... +def operation_to_ldif(operation_type, entries, all_base64: bool = ..., sort_order: Any | None = ...): ... +def add_ldif_header(ldif_lines): ... +def ldif_sort(line, sort_order): ... +def decode_persistent_search_control(change): ... +def persistent_search_response_to_ldif(change): ... diff --git a/stubs/ldap3/ldap3/protocol/rfc3062.pyi b/stubs/ldap3/ldap3/protocol/rfc3062.pyi new file mode 100644 index 000000000000..c508ccbbfb10 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/rfc3062.pyi @@ -0,0 +1,28 @@ +from typing import Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.type.univ import OctetString, Sequence +OctetString = Any +Sequence = Any + +class UserIdentity(OctetString): + tagSet: Any + encoding: str + +class OldPasswd(OctetString): + tagSet: Any + encoding: str + +class NewPasswd(OctetString): + tagSet: Any + encoding: str + +class GenPasswd(OctetString): + tagSet: Any + encoding: str + +class PasswdModifyRequestValue(Sequence): + componentType: Any + +class PasswdModifyResponseValue(Sequence): + componentType: Any diff --git a/stubs/ldap3/ldap3/protocol/rfc4511.pyi b/stubs/ldap3/ldap3/protocol/rfc4511.pyi new file mode 100644 index 000000000000..070910ae3868 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/rfc4511.pyi @@ -0,0 +1,323 @@ +from typing import Any as _Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.type.univ import Boolean, Choice, Enumerated, Integer, Null, OctetString, Sequence, SequenceOf, SetOf +Boolean = _Any +Choice = _Any +Enumerated = _Any +Integer = _Any +Null = _Any +OctetString = _Any +Sequence = _Any +SequenceOf = _Any +SetOf = _Any + +LDAP_MAX_INT: int +MAXINT: _Any +rangeInt0ToMaxConstraint: _Any +rangeInt1To127Constraint: _Any +size1ToMaxConstraint: _Any +responseValueConstraint: _Any +numericOIDConstraint: _Any +distinguishedNameConstraint: _Any +nameComponentConstraint: _Any +attributeDescriptionConstraint: _Any +uriConstraint: _Any +attributeSelectorConstraint: _Any + +class Integer0ToMax(Integer): + subtypeSpec: _Any + +class LDAPString(OctetString): + encoding: str + +class MessageID(Integer0ToMax): ... +class LDAPOID(OctetString): ... +class LDAPDN(LDAPString): ... +class RelativeLDAPDN(LDAPString): ... +class AttributeDescription(LDAPString): ... + +class AttributeValue(OctetString): + encoding: str + +class AssertionValue(OctetString): + encoding: str + +class AttributeValueAssertion(Sequence): + componentType: _Any + +class MatchingRuleId(LDAPString): ... + +class Vals(SetOf): + componentType: _Any + +class ValsAtLeast1(SetOf): + componentType: _Any + subtypeSpec: _Any + +class PartialAttribute(Sequence): + componentType: _Any + +class Attribute(Sequence): + componentType: _Any + +class AttributeList(SequenceOf): + componentType: _Any + +class Simple(OctetString): + tagSet: _Any + encoding: str + +class Credentials(OctetString): + encoding: str + +class SaslCredentials(Sequence): + tagSet: _Any + componentType: _Any + +class SicilyPackageDiscovery(OctetString): + tagSet: _Any + encoding: str + +class SicilyNegotiate(OctetString): + tagSet: _Any + encoding: str + +class SicilyResponse(OctetString): + tagSet: _Any + encoding: str + +class AuthenticationChoice(Choice): + componentType: _Any + +class Version(Integer): + subtypeSpec: _Any + +class ResultCode(Enumerated): + namedValues: _Any + subTypeSpec: _Any + +class URI(LDAPString): ... + +class Referral(SequenceOf): + tagSet: _Any + componentType: _Any + +class ServerSaslCreds(OctetString): + tagSet: _Any + encoding: str + +class LDAPResult(Sequence): + componentType: _Any + +class Criticality(Boolean): + defaultValue: bool + +class ControlValue(OctetString): + encoding: str + +class Control(Sequence): + componentType: _Any + +class Controls(SequenceOf): + tagSet: _Any + componentType: _Any + +class Scope(Enumerated): + namedValues: _Any + +class DerefAliases(Enumerated): + namedValues: _Any + +class TypesOnly(Boolean): ... +class Selector(LDAPString): ... + +class AttributeSelection(SequenceOf): + componentType: _Any + +class MatchingRule(MatchingRuleId): + tagSet: _Any + +class Type(AttributeDescription): + tagSet: _Any + +class MatchValue(AssertionValue): + tagSet: _Any + +class DnAttributes(Boolean): + tagSet: _Any + defaultValue: _Any + +class MatchingRuleAssertion(Sequence): + componentType: _Any + +class Initial(AssertionValue): + tagSet: _Any + +class Any(AssertionValue): + tagSet: _Any + +class Final(AssertionValue): + tagSet: _Any + +class Substring(Choice): + componentType: _Any + +class Substrings(SequenceOf): + subtypeSpec: _Any + componentType: _Any + +class SubstringFilter(Sequence): + tagSet: _Any + componentType: _Any + +class And(SetOf): + tagSet: _Any + subtypeSpec: _Any + +class Or(SetOf): + tagSet: _Any + subtypeSpec: _Any + +class Not(Choice): ... + +class EqualityMatch(AttributeValueAssertion): + tagSet: _Any + +class GreaterOrEqual(AttributeValueAssertion): + tagSet: _Any + +class LessOrEqual(AttributeValueAssertion): + tagSet: _Any + +class Present(AttributeDescription): + tagSet: _Any + +class ApproxMatch(AttributeValueAssertion): + tagSet: _Any + +class ExtensibleMatch(MatchingRuleAssertion): + tagSet: _Any + +class Filter(Choice): + componentType: _Any + +class PartialAttributeList(SequenceOf): + componentType: _Any + +class Operation(Enumerated): + namedValues: _Any + +class Change(Sequence): + componentType: _Any + +class Changes(SequenceOf): + componentType: _Any + +class DeleteOldRDN(Boolean): ... + +class NewSuperior(LDAPDN): + tagSet: _Any + +class RequestName(LDAPOID): + tagSet: _Any + +class RequestValue(OctetString): + tagSet: _Any + encoding: str + +class ResponseName(LDAPOID): + tagSet: _Any + +class ResponseValue(OctetString): + tagSet: _Any + encoding: str + +class IntermediateResponseName(LDAPOID): + tagSet: _Any + +class IntermediateResponseValue(OctetString): + tagSet: _Any + encoding: str + +class BindRequest(Sequence): + tagSet: _Any + componentType: _Any + +class BindResponse(Sequence): + tagSet: _Any + componentType: _Any + +class UnbindRequest(Null): + tagSet: _Any + +class SearchRequest(Sequence): + tagSet: _Any + componentType: _Any + +class SearchResultReference(SequenceOf): + tagSet: _Any + subtypeSpec: _Any + componentType: _Any + +class SearchResultEntry(Sequence): + tagSet: _Any + componentType: _Any + +class SearchResultDone(LDAPResult): + tagSet: _Any + +class ModifyRequest(Sequence): + tagSet: _Any + componentType: _Any + +class ModifyResponse(LDAPResult): + tagSet: _Any + +class AddRequest(Sequence): + tagSet: _Any + componentType: _Any + +class AddResponse(LDAPResult): + tagSet: _Any + +class DelRequest(LDAPDN): + tagSet: _Any + +class DelResponse(LDAPResult): + tagSet: _Any + +class ModifyDNRequest(Sequence): + tagSet: _Any + componentType: _Any + +class ModifyDNResponse(LDAPResult): + tagSet: _Any + +class CompareRequest(Sequence): + tagSet: _Any + componentType: _Any + +class CompareResponse(LDAPResult): + tagSet: _Any + +class AbandonRequest(MessageID): + tagSet: _Any + +class ExtendedRequest(Sequence): + tagSet: _Any + componentType: _Any + +class ExtendedResponse(Sequence): + tagSet: _Any + componentType: _Any + +class IntermediateResponse(Sequence): + tagSet: _Any + componentType: _Any + +class ProtocolOp(Choice): + componentType: _Any + +class LDAPMessage(Sequence): + componentType: _Any diff --git a/stubs/ldap3/ldap3/protocol/rfc4512.pyi b/stubs/ldap3/ldap3/protocol/rfc4512.pyi new file mode 100644 index 000000000000..816dfeb2d0a6 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/rfc4512.pyi @@ -0,0 +1,218 @@ +from typing import Any + +def constant_to_class_kind(value): ... +def constant_to_attribute_usage(value): ... +def attribute_usage_to_constant(value): ... +def quoted_string_to_list(quoted_string): ... +def oids_string_to_list(oid_string): ... +def extension_to_tuple(extension_string): ... +def list_to_string(list_object): ... + +class BaseServerInfo: + raw: Any + def __init__(self, raw_attributes) -> None: ... + @classmethod + def from_json(cls, json_definition, schema: Any | None = ..., custom_formatter: Any | None = ...): ... + @classmethod + def from_file(cls, target, schema: Any | None = ..., custom_formatter: Any | None = ...): ... + def to_file(self, target, indent: int = ..., sort: bool = ...) -> None: ... + def to_json(self, indent: int = ..., sort: bool = ...): ... + +class DsaInfo(BaseServerInfo): + alt_servers: Any + naming_contexts: Any + supported_controls: Any + supported_extensions: Any + supported_features: Any + supported_ldap_versions: Any + supported_sasl_mechanisms: Any + vendor_name: Any + vendor_version: Any + schema_entry: Any + other: Any + def __init__(self, attributes, raw_attributes) -> None: ... + +class SchemaInfo(BaseServerInfo): + schema_entry: Any + create_time_stamp: Any + modify_time_stamp: Any + attribute_types: Any + object_classes: Any + matching_rules: Any + matching_rule_uses: Any + dit_content_rules: Any + dit_structure_rules: Any + name_forms: Any + ldap_syntaxes: Any + other: Any + def __init__(self, schema_entry, attributes, raw_attributes) -> None: ... + def is_valid(self): ... + +class BaseObjectInfo: + oid: Any + name: Any + description: Any + obsolete: Any + extensions: Any + experimental: Any + raw_definition: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + @property + def oid_info(self): ... + @classmethod + def from_definition(cls, definitions): ... + +class MatchingRuleInfo(BaseObjectInfo): + syntax: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + syntax: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class MatchingRuleUseInfo(BaseObjectInfo): + apply_to: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + apply_to: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class ObjectClassInfo(BaseObjectInfo): + superior: Any + kind: Any + must_contain: Any + may_contain: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + superior: Any | None = ..., + kind: Any | None = ..., + must_contain: Any | None = ..., + may_contain: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class AttributeTypeInfo(BaseObjectInfo): + superior: Any + equality: Any + ordering: Any + substring: Any + syntax: Any + min_length: Any + single_value: Any + collective: Any + no_user_modification: Any + usage: Any + mandatory_in: Any + optional_in: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + superior: Any | None = ..., + equality: Any | None = ..., + ordering: Any | None = ..., + substring: Any | None = ..., + syntax: Any | None = ..., + min_length: Any | None = ..., + single_value: bool = ..., + collective: bool = ..., + no_user_modification: bool = ..., + usage: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class LdapSyntaxInfo(BaseObjectInfo): + def __init__( + self, + oid: Any | None = ..., + description: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class DitContentRuleInfo(BaseObjectInfo): + auxiliary_classes: Any + must_contain: Any + may_contain: Any + not_contains: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + auxiliary_classes: Any | None = ..., + must_contain: Any | None = ..., + may_contain: Any | None = ..., + not_contains: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class DitStructureRuleInfo(BaseObjectInfo): + superior: Any + name_form: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + name_form: Any | None = ..., + superior: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class NameFormInfo(BaseObjectInfo): + object_class: Any + must_contain: Any + may_contain: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + object_class: Any | None = ..., + must_contain: Any | None = ..., + may_contain: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... diff --git a/stubs/ldap3/ldap3/protocol/rfc4527.pyi b/stubs/ldap3/ldap3/protocol/rfc4527.pyi new file mode 100644 index 000000000000..eacc393c49c1 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/rfc4527.pyi @@ -0,0 +1,2 @@ +def pre_read_control(attributes, criticality: bool = ...): ... +def post_read_control(attributes, criticality: bool = ...): ... diff --git a/stubs/ldap3/ldap3/protocol/sasl/__init__.pyi b/stubs/ldap3/ldap3/protocol/sasl/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/ldap3/ldap3/protocol/sasl/digestMd5.pyi b/stubs/ldap3/ldap3/protocol/sasl/digestMd5.pyi new file mode 100644 index 000000000000..433416f25d27 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/sasl/digestMd5.pyi @@ -0,0 +1,9 @@ +STATE_KEY: int +STATE_VALUE: int + +def md5_h(value): ... +def md5_kd(k, s): ... +def md5_hex(value): ... +def md5_hmac(k, s): ... +def sasl_digest_md5(connection, controls): ... +def decode_directives(directives_string): ... diff --git a/stubs/ldap3/ldap3/protocol/sasl/external.pyi b/stubs/ldap3/ldap3/protocol/sasl/external.pyi new file mode 100644 index 000000000000..8403ee7944af --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/sasl/external.pyi @@ -0,0 +1 @@ +def sasl_external(connection, controls): ... diff --git a/stubs/ldap3/ldap3/protocol/sasl/kerberos.pyi b/stubs/ldap3/ldap3/protocol/sasl/kerberos.pyi new file mode 100644 index 000000000000..7a795b210a71 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/sasl/kerberos.pyi @@ -0,0 +1,8 @@ +posix_gssapi_unavailable: bool +windows_gssapi_unavailable: bool +NO_SECURITY_LAYER: int +INTEGRITY_PROTECTION: int +CONFIDENTIALITY_PROTECTION: int + +def get_channel_bindings(ssl_socket): ... +def sasl_gssapi(connection, controls): ... diff --git a/stubs/ldap3/ldap3/protocol/sasl/plain.pyi b/stubs/ldap3/ldap3/protocol/sasl/plain.pyi new file mode 100644 index 000000000000..5be879c5abef --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/sasl/plain.pyi @@ -0,0 +1 @@ +def sasl_plain(connection, controls): ... diff --git a/stubs/ldap3/ldap3/protocol/sasl/sasl.pyi b/stubs/ldap3/ldap3/protocol/sasl/sasl.pyi new file mode 100644 index 000000000000..564c26ab5dc7 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/sasl/sasl.pyi @@ -0,0 +1,5 @@ +def sasl_prep(data): ... +def validate_simple_password(password, accept_empty: bool = ...): ... +def abort_sasl_negotiation(connection, controls): ... +def send_sasl_negotiation(connection, controls, payload): ... +def random_hex_string(size): ... diff --git a/stubs/ldap3/ldap3/protocol/schemas/__init__.pyi b/stubs/ldap3/ldap3/protocol/schemas/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/ldap3/ldap3/protocol/schemas/ad2012R2.pyi b/stubs/ldap3/ldap3/protocol/schemas/ad2012R2.pyi new file mode 100644 index 000000000000..3f484293670c --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/schemas/ad2012R2.pyi @@ -0,0 +1,2 @@ +ad_2012_r2_schema: str +ad_2012_r2_dsa_info: str diff --git a/stubs/ldap3/ldap3/protocol/schemas/ds389.pyi b/stubs/ldap3/ldap3/protocol/schemas/ds389.pyi new file mode 100644 index 000000000000..4d90cdc59857 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/schemas/ds389.pyi @@ -0,0 +1,2 @@ +ds389_1_3_3_schema: str +ds389_1_3_3_dsa_info: str diff --git a/stubs/ldap3/ldap3/protocol/schemas/edir888.pyi b/stubs/ldap3/ldap3/protocol/schemas/edir888.pyi new file mode 100644 index 000000000000..5b982a48e0d1 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/schemas/edir888.pyi @@ -0,0 +1,2 @@ +edir_8_8_8_schema: str +edir_8_8_8_dsa_info: str diff --git a/stubs/ldap3/ldap3/protocol/schemas/edir914.pyi b/stubs/ldap3/ldap3/protocol/schemas/edir914.pyi new file mode 100644 index 000000000000..d7c9cf64f817 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/schemas/edir914.pyi @@ -0,0 +1,2 @@ +edir_9_1_4_schema: str +edir_9_1_4_dsa_info: str diff --git a/stubs/ldap3/ldap3/protocol/schemas/slapd24.pyi b/stubs/ldap3/ldap3/protocol/schemas/slapd24.pyi new file mode 100644 index 000000000000..c080d0820aa0 --- /dev/null +++ b/stubs/ldap3/ldap3/protocol/schemas/slapd24.pyi @@ -0,0 +1,2 @@ +slapd_2_4_schema: str +slapd_2_4_dsa_info: str diff --git a/stubs/ldap3/ldap3/strategy/__init__.pyi b/stubs/ldap3/ldap3/strategy/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/ldap3/ldap3/strategy/asyncStream.pyi b/stubs/ldap3/ldap3/strategy/asyncStream.pyi new file mode 100644 index 000000000000..b0ed1b4fd07e --- /dev/null +++ b/stubs/ldap3/ldap3/strategy/asyncStream.pyi @@ -0,0 +1,18 @@ +from typing import Any + +from ..strategy.asynchronous import AsyncStrategy + +class AsyncStreamStrategy(AsyncStrategy): + can_stream: bool + line_separator: Any + all_base64: bool + stream: Any + order: Any + persistent_search_message_id: Any + streaming: bool + callback: Any + events: Any + def __init__(self, ldap_connection) -> None: ... + def accumulate_stream(self, message_id, change) -> None: ... + def get_stream(self): ... + def set_stream(self, value) -> None: ... diff --git a/stubs/ldap3/ldap3/strategy/asynchronous.pyi b/stubs/ldap3/ldap3/strategy/asynchronous.pyi new file mode 100644 index 000000000000..ecc746f863f3 --- /dev/null +++ b/stubs/ldap3/ldap3/strategy/asynchronous.pyi @@ -0,0 +1,27 @@ +from threading import Thread +from typing import Any + +from ..strategy.base import BaseStrategy + +class AsyncStrategy(BaseStrategy): + class ReceiverSocketThread(Thread): + connection: Any + socket_size: Any + def __init__(self, ldap_connection) -> None: ... + def run(self) -> None: ... + sync: bool + no_real_dsa: bool + pooled: bool + can_stream: bool + receiver: Any + async_lock: Any + event_lock: Any + def __init__(self, ldap_connection) -> None: ... + def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... + def close(self) -> None: ... + def set_event_for_message(self, message_id) -> None: ... + def post_send_search(self, message_id): ... + def post_send_single_response(self, message_id): ... + def receiving(self) -> None: ... + def get_stream(self) -> None: ... + def set_stream(self, value) -> None: ... diff --git a/stubs/ldap3/ldap3/strategy/base.pyi b/stubs/ldap3/ldap3/strategy/base.pyi new file mode 100644 index 000000000000..4c7a07a1a415 --- /dev/null +++ b/stubs/ldap3/ldap3/strategy/base.pyi @@ -0,0 +1,42 @@ +from typing import Any + +unix_socket_available: bool +SESSION_TERMINATED_BY_SERVER: str +TRANSACTION_ERROR: str +RESPONSE_COMPLETE: str + +class BaseStrategy: + connection: Any + sync: Any + no_real_dsa: Any + pooled: Any + can_stream: Any + referral_cache: Any + thread_safe: bool + def __init__(self, ldap_connection) -> None: ... + def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... + def close(self) -> None: ... + def send(self, message_type, request, controls: Any | None = ...): ... + def get_response(self, message_id, timeout: Any | None = ..., get_request: bool = ...): ... + @staticmethod + def compute_ldap_message_size(data): ... + def decode_response(self, ldap_message): ... + def decode_response_fast(self, ldap_message): ... + @staticmethod + def decode_control(control): ... + @staticmethod + def decode_control_fast(control, from_server: bool = ...): ... + @staticmethod + def decode_request(message_type, component, controls: Any | None = ...): ... + def valid_referral_list(self, referrals): ... + def do_next_range_search(self, request, response, attr_name): ... + def do_search_on_auto_range(self, request, response): ... + def create_referral_connection(self, referrals): ... + def do_operation_on_referral(self, request, referrals): ... + def sending(self, ldap_message) -> None: ... + def receiving(self) -> None: ... + def post_send_single_response(self, message_id) -> None: ... + def post_send_search(self, message_id) -> None: ... + def get_stream(self) -> None: ... + def set_stream(self, value) -> None: ... + def unbind_referral_cache(self) -> None: ... diff --git a/stubs/ldap3/ldap3/strategy/ldifProducer.pyi b/stubs/ldap3/ldap3/strategy/ldifProducer.pyi new file mode 100644 index 000000000000..7ac55a30b077 --- /dev/null +++ b/stubs/ldap3/ldap3/strategy/ldifProducer.pyi @@ -0,0 +1,21 @@ +from typing import Any + +from .base import BaseStrategy + +class LdifProducerStrategy(BaseStrategy): + sync: bool + no_real_dsa: bool + pooled: bool + can_stream: bool + line_separator: Any + all_base64: bool + stream: Any + order: Any + def __init__(self, ldap_connection) -> None: ... + def receiving(self) -> None: ... + def send(self, message_type, request, controls: Any | None = ...): ... + def post_send_single_response(self, message_id): ... + def post_send_search(self, message_id) -> None: ... + def accumulate_stream(self, fragment) -> None: ... + def get_stream(self): ... + def set_stream(self, value) -> None: ... diff --git a/stubs/ldap3/ldap3/strategy/mockAsync.pyi b/stubs/ldap3/ldap3/strategy/mockAsync.pyi new file mode 100644 index 000000000000..2acd74751413 --- /dev/null +++ b/stubs/ldap3/ldap3/strategy/mockAsync.pyi @@ -0,0 +1,11 @@ +from typing import Any + +from .asynchronous import AsyncStrategy +from .mockBase import MockBaseStrategy + +class MockAsyncStrategy(MockBaseStrategy, AsyncStrategy): + def __init__(self, ldap_connection) -> None: ... + def post_send_search(self, payload): ... + bound: Any + def post_send_single_response(self, payload): ... + def get_response(self, message_id, timeout: Any | None = ..., get_request: bool = ...): ... diff --git a/stubs/ldap3/ldap3/strategy/mockBase.pyi b/stubs/ldap3/ldap3/strategy/mockBase.pyi new file mode 100644 index 000000000000..c4b0c3483047 --- /dev/null +++ b/stubs/ldap3/ldap3/strategy/mockBase.pyi @@ -0,0 +1,37 @@ +from typing import Any + +SEARCH_CONTROLS: Any +SERVER_ENCODING: str + +def random_cookie(): ... + +class PagedSearchSet: + size: Any + response: Any + cookie: Any + sent: int + done: bool + def __init__(self, response, size, criticality) -> None: ... + def next(self, size: Any | None = ...): ... + +class MockBaseStrategy: + entries: Any + no_real_dsa: bool + bound: Any + custom_validators: Any + operational_attributes: Any + def __init__(self) -> None: ... + def add_entry(self, dn, attributes, validate: bool = ...): ... + def remove_entry(self, dn): ... + def entries_from_json(self, json_entry_file) -> None: ... + def mock_bind(self, request_message, controls): ... + def mock_delete(self, request_message, controls): ... + def mock_add(self, request_message, controls): ... + def mock_compare(self, request_message, controls): ... + def mock_modify_dn(self, request_message, controls): ... + def mock_modify(self, request_message, controls): ... + def mock_search(self, request_message, controls): ... + def mock_extended(self, request_message, controls): ... + def evaluate_filter_node(self, node, candidates): ... + def equal(self, dn, attribute_type, value_to_check): ... + def send(self, message_type, request, controls: Any | None = ...): ... diff --git a/stubs/ldap3/ldap3/strategy/mockSync.pyi b/stubs/ldap3/ldap3/strategy/mockSync.pyi new file mode 100644 index 000000000000..dcfd12d8958b --- /dev/null +++ b/stubs/ldap3/ldap3/strategy/mockSync.pyi @@ -0,0 +1,10 @@ +from typing import Any + +from .mockBase import MockBaseStrategy +from .sync import SyncStrategy + +class MockSyncStrategy(MockBaseStrategy, SyncStrategy): + def __init__(self, ldap_connection) -> None: ... + def post_send_search(self, payload): ... + bound: Any + def post_send_single_response(self, payload): ... diff --git a/stubs/ldap3/ldap3/strategy/restartable.pyi b/stubs/ldap3/ldap3/strategy/restartable.pyi new file mode 100644 index 000000000000..d38804ee0f85 --- /dev/null +++ b/stubs/ldap3/ldap3/strategy/restartable.pyi @@ -0,0 +1,19 @@ +from typing import Any + +from .sync import SyncStrategy + +class RestartableStrategy(SyncStrategy): + sync: bool + no_real_dsa: bool + pooled: bool + can_stream: bool + restartable_sleep_time: Any + restartable_tries: Any + exception_history: Any + def __init__(self, ldap_connection) -> None: ... + def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... + def send(self, message_type, request, controls: Any | None = ...): ... + def post_send_single_response(self, message_id): ... + def post_send_search(self, message_id): ... + def get_stream(self) -> None: ... + def set_stream(self, value) -> None: ... diff --git a/stubs/ldap3/ldap3/strategy/reusable.pyi b/stubs/ldap3/ldap3/strategy/reusable.pyi new file mode 100644 index 000000000000..cc5bfad4101c --- /dev/null +++ b/stubs/ldap3/ldap3/strategy/reusable.pyi @@ -0,0 +1,71 @@ +from threading import Thread +from typing import Any + +from .base import BaseStrategy + +TERMINATE_REUSABLE: str +BOGUS_BIND: int +BOGUS_UNBIND: int +BOGUS_EXTENDED: int +BOGUS_ABANDON: int + +class ReusableStrategy(BaseStrategy): + pools: Any + def receiving(self) -> None: ... + def get_stream(self) -> None: ... + def set_stream(self, value) -> None: ... + class ConnectionPool: + def __new__(cls, connection): ... + name: Any + master_connection: Any + workers: Any + pool_size: Any + lifetime: Any + keepalive: Any + request_queue: Any + open_pool: bool + bind_pool: bool + tls_pool: bool + counter: int + terminated_usage: Any + terminated: bool + pool_lock: Any + started: bool + def __init__(self, connection) -> None: ... + def get_info_from_server(self) -> None: ... + def rebind_pool(self) -> None: ... + def start_pool(self): ... + def create_pool(self) -> None: ... + def terminate_pool(self) -> None: ... + class PooledConnectionThread(Thread): + daemon: bool + worker: Any + master_connection: Any + def __init__(self, worker, master_connection) -> None: ... + def run(self) -> None: ... + class PooledConnectionWorker: + master_connection: Any + request_queue: Any + running: bool + busy: bool + get_info_from_server: bool + connection: Any + creation_time: Any + task_counter: int + thread: Any + worker_lock: Any + def __init__(self, connection, request_queue) -> None: ... + def new_connection(self) -> None: ... + sync: bool + no_real_dsa: bool + pooled: bool + can_stream: bool + pool: Any + def __init__(self, ldap_connection) -> None: ... + def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... + def terminate(self) -> None: ... + def send(self, message_type, request, controls: Any | None = ...): ... + def validate_bind(self, controls): ... + def get_response(self, counter, timeout: Any | None = ..., get_request: bool = ...): ... + def post_send_single_response(self, counter): ... + def post_send_search(self, counter): ... diff --git a/stubs/ldap3/ldap3/strategy/safeRestartable.pyi b/stubs/ldap3/ldap3/strategy/safeRestartable.pyi new file mode 100644 index 000000000000..b52aa5a1b4a1 --- /dev/null +++ b/stubs/ldap3/ldap3/strategy/safeRestartable.pyi @@ -0,0 +1,5 @@ +from .restartable import RestartableStrategy + +class SafeRestartableStrategy(RestartableStrategy): + thread_safe: bool + def __init__(self, ldap_connection) -> None: ... diff --git a/stubs/ldap3/ldap3/strategy/safeSync.pyi b/stubs/ldap3/ldap3/strategy/safeSync.pyi new file mode 100644 index 000000000000..2b8b51390eb8 --- /dev/null +++ b/stubs/ldap3/ldap3/strategy/safeSync.pyi @@ -0,0 +1,5 @@ +from .sync import SyncStrategy + +class SafeSyncStrategy(SyncStrategy): + thread_safe: bool + def __init__(self, ldap_connection) -> None: ... diff --git a/stubs/ldap3/ldap3/strategy/sync.pyi b/stubs/ldap3/ldap3/strategy/sync.pyi new file mode 100644 index 000000000000..a1a8460902e2 --- /dev/null +++ b/stubs/ldap3/ldap3/strategy/sync.pyi @@ -0,0 +1,19 @@ +from typing import Any + +from ..strategy.base import BaseStrategy + +LDAP_MESSAGE_TEMPLATE: Any + +class SyncStrategy(BaseStrategy): + sync: bool + no_real_dsa: bool + pooled: bool + can_stream: bool + socket_size: Any + def __init__(self, ldap_connection) -> None: ... + def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... + def receiving(self): ... + def post_send_single_response(self, message_id): ... + def post_send_search(self, message_id): ... + def set_stream(self, value) -> None: ... + def get_stream(self) -> None: ... diff --git a/stubs/ldap3/ldap3/utils/__init__.pyi b/stubs/ldap3/ldap3/utils/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/ldap3/ldap3/utils/asn1.pyi b/stubs/ldap3/ldap3/utils/asn1.pyi new file mode 100644 index 000000000000..859a9b958630 --- /dev/null +++ b/stubs/ldap3/ldap3/utils/asn1.pyi @@ -0,0 +1,37 @@ +from typing import Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.codec.ber.encoder import AbstractItemEncoder, BooleanEncoder +AbstractItemEncoder = Any +BooleanEncoder = Any + +CLASSES: Any + +class LDAPBooleanEncoder(AbstractItemEncoder): + supportIndefLenMode: bool + # Requires pyasn1 > 0.3.7 + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +customTagMap: Any +customTypeMap: Any + +def compute_ber_size(data): ... +def decode_message_fast(message): ... +def decode_sequence(message, start, stop, context_decoders: Any | None = ...): ... +def decode_integer(message, start, stop, context_decoders: Any | None = ...): ... +def decode_octet_string(message, start, stop, context_decoders: Any | None = ...): ... +def decode_boolean(message, start, stop, context_decoders: Any | None = ...): ... +def decode_bind_response(message, start, stop, context_decoders: Any | None = ...): ... +def decode_extended_response(message, start, stop, context_decoders: Any | None = ...): ... +def decode_intermediate_response(message, start, stop, context_decoders: Any | None = ...): ... +def decode_controls(message, start, stop, context_decoders: Any | None = ...): ... +def ldap_result_to_dict_fast(response): ... +def get_byte(x): ... +def get_bytes(x): ... + +DECODERS: Any +BIND_RESPONSE_CONTEXT: Any +EXTENDED_RESPONSE_CONTEXT: Any +INTERMEDIATE_RESPONSE_CONTEXT: Any +LDAP_MESSAGE_CONTEXT: Any +CONTROLS_CONTEXT: Any diff --git a/stubs/ldap3/ldap3/utils/ciDict.pyi b/stubs/ldap3/ldap3/utils/ciDict.pyi new file mode 100644 index 000000000000..2564fc656c57 --- /dev/null +++ b/stubs/ldap3/ldap3/utils/ciDict.pyi @@ -0,0 +1,29 @@ +from collections.abc import MutableMapping +from typing import Any, Generic, TypeVar + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +class CaseInsensitiveDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + def __init__(self, other: Any | None = ..., **kwargs) -> None: ... + def __contains__(self, item): ... + def __delitem__(self, key) -> None: ... + def __setitem__(self, key, item) -> None: ... + def __getitem__(self, key): ... + def __iter__(self): ... + def __len__(self): ... + def keys(self): ... + def values(self): ... + def items(self): ... + def __eq__(self, other): ... + def copy(self): ... + +class CaseInsensitiveWithAliasDict(CaseInsensitiveDict[_KT, _VT], Generic[_KT, _VT]): + def __init__(self, other: Any | None = ..., **kwargs) -> None: ... + def aliases(self): ... + def __setitem__(self, key, value) -> None: ... + def __delitem__(self, key) -> None: ... + def set_alias(self, key, alias, ignore_duplicates: bool = ...) -> None: ... + def remove_alias(self, alias) -> None: ... + def __getitem__(self, key): ... + def copy(self): ... diff --git a/stubs/ldap3/ldap3/utils/config.pyi b/stubs/ldap3/ldap3/utils/config.pyi new file mode 100644 index 000000000000..80971d5fc15c --- /dev/null +++ b/stubs/ldap3/ldap3/utils/config.pyi @@ -0,0 +1,6 @@ +from typing import Any + +PARAMETERS: Any + +def get_config_parameter(parameter): ... +def set_config_parameter(parameter, value) -> None: ... diff --git a/stubs/ldap3/ldap3/utils/conv.pyi b/stubs/ldap3/ldap3/utils/conv.pyi new file mode 100644 index 000000000000..280e2085cfec --- /dev/null +++ b/stubs/ldap3/ldap3/utils/conv.pyi @@ -0,0 +1,14 @@ +from typing import Any + +def to_unicode(obj: float | bytes | str, encoding: str | None = ..., from_server: bool = ...) -> str: ... +def to_raw(obj, encoding: str = ...): ... +def escape_filter_chars(text: float | bytes | str, encoding: str | None = ...) -> str: ... +def unescape_filter_chars(text, encoding: Any | None = ...): ... +def escape_bytes(bytes_value: str | bytes) -> str: ... +def prepare_for_stream(value): ... +def json_encode_b64(obj): ... +def check_json_dict(json_dict) -> None: ... +def json_hook(obj): ... +def format_json(obj, iso_format: bool = ...): ... +def is_filter_escaped(text): ... +def ldap_escape_to_bytes(text): ... diff --git a/stubs/ldap3/ldap3/utils/dn.pyi b/stubs/ldap3/ldap3/utils/dn.pyi new file mode 100644 index 000000000000..dab0cdffd451 --- /dev/null +++ b/stubs/ldap3/ldap3/utils/dn.pyi @@ -0,0 +1,11 @@ +STATE_ANY: int +STATE_ESCAPE: int +STATE_ESCAPE_HEX: int + +def to_dn( + iterator, decompose: bool = ..., remove_space: bool = ..., space_around_equal: bool = ..., separate_rdn: bool = ... +): ... +def parse_dn(dn, escape: bool = ..., strip: bool = ...): ... +def safe_dn(dn, decompose: bool = ..., reverse: bool = ...): ... +def safe_rdn(dn, decompose: bool = ...): ... +def escape_rdn(rdn: str) -> str: ... diff --git a/stubs/ldap3/ldap3/utils/hashed.pyi b/stubs/ldap3/ldap3/utils/hashed.pyi new file mode 100644 index 000000000000..74734cc6339e --- /dev/null +++ b/stubs/ldap3/ldap3/utils/hashed.pyi @@ -0,0 +1,6 @@ +from typing import Any + +algorithms_table: Any +salted_table: Any + +def hashed(algorithm, value, salt: Any | None = ..., raw: bool = ..., encoding: str = ...): ... diff --git a/stubs/ldap3/ldap3/utils/log.pyi b/stubs/ldap3/ldap3/utils/log.pyi new file mode 100644 index 000000000000..a5c47f7bdf4f --- /dev/null +++ b/stubs/ldap3/ldap3/utils/log.pyi @@ -0,0 +1,25 @@ +from logging import NullHandler as NullHandler +from typing import Any + +OFF: int +ERROR: int +BASIC: int +PROTOCOL: int +NETWORK: int +EXTENDED: int +DETAIL_LEVELS: Any + +def get_detail_level_name(level_name): ... +def log(detail, message, *args) -> None: ... +def log_enabled(detail): ... +def set_library_log_hide_sensitive_data(hide: bool = ...) -> None: ... +def get_library_log_hide_sensitive_data(): ... +def set_library_log_activation_level(logging_level) -> None: ... +def get_library_log_activation_lavel(): ... +def set_library_log_max_line_length(length) -> None: ... +def get_library_log_max_line_length(): ... +def set_library_log_detail_level(detail) -> None: ... +def get_library_log_detail_level(): ... +def format_ldap_message(message, prefix): ... + +logger: Any diff --git a/stubs/ldap3/ldap3/utils/ntlm.pyi b/stubs/ldap3/ldap3/utils/ntlm.pyi new file mode 100644 index 000000000000..6e122f3a778d --- /dev/null +++ b/stubs/ldap3/ldap3/utils/ntlm.pyi @@ -0,0 +1,117 @@ +from typing import Any + +oem_encoding: Any +NTLM_SIGNATURE: bytes +NTLM_MESSAGE_TYPE_NTLM_NEGOTIATE: int +NTLM_MESSAGE_TYPE_NTLM_CHALLENGE: int +NTLM_MESSAGE_TYPE_NTLM_AUTHENTICATE: int +FLAG_NEGOTIATE_56: int +FLAG_NEGOTIATE_KEY_EXCH: int +FLAG_NEGOTIATE_128: int +FLAG_NEGOTIATE_VERSION: int +FLAG_NEGOTIATE_TARGET_INFO: int +FLAG_REQUEST_NOT_NT_SESSION_KEY: int +FLAG_NEGOTIATE_IDENTIFY: int +FLAG_NEGOTIATE_EXTENDED_SESSIONSECURITY: int +FLAG_TARGET_TYPE_SERVER: int +FLAG_TARGET_TYPE_DOMAIN: int +FLAG_NEGOTIATE_ALWAYS_SIGN: int +FLAG_NEGOTIATE_OEM_WORKSTATION_SUPPLIED: int +FLAG_NEGOTIATE_OEM_DOMAIN_SUPPLIED: int +FLAG_NEGOTIATE_ANONYMOUS: int +FLAG_NEGOTIATE_NTLM: int +FLAG_NEGOTIATE_LM_KEY: int +FLAG_NEGOTIATE_DATAGRAM: int +FLAG_NEGOTIATE_SEAL: int +FLAG_NEGOTIATE_SIGN: int +FLAG_REQUEST_TARGET: int +FLAG_NEGOTIATE_OEM: int +FLAG_NEGOTIATE_UNICODE: int +FLAG_TYPES: Any +AV_END_OF_LIST: int +AV_NETBIOS_COMPUTER_NAME: int +AV_NETBIOS_DOMAIN_NAME: int +AV_DNS_COMPUTER_NAME: int +AV_DNS_DOMAIN_NAME: int +AV_DNS_TREE_NAME: int +AV_FLAGS: int +AV_TIMESTAMP: int +AV_SINGLE_HOST_DATA: int +AV_TARGET_NAME: int +AV_CHANNEL_BINDINGS: int +AV_TYPES: Any +AV_FLAG_CONSTRAINED: int +AV_FLAG_INTEGRITY: int +AV_FLAG_TARGET_SPN_UNTRUSTED: int +AV_FLAG_TYPES: Any + +def pack_windows_version(debug: bool = ...): ... +def unpack_windows_version(version_message): ... + +class NtlmClient: + client_config_flags: int + exported_session_key: Any + negotiated_flags: Any + user_name: Any + user_domain: Any + no_lm_response_ntlm_v1: Any + client_blocked: bool + client_block_exceptions: Any + client_require_128_bit_encryption: Any + max_life_time: Any + client_signing_key: Any + client_sealing_key: Any + sequence_number: Any + server_sealing_key: Any + server_signing_key: Any + integrity: bool + replay_detect: bool + sequence_detect: bool + confidentiality: bool + datagram: bool + identity: bool + client_supplied_target_name: Any + client_channel_binding_unhashed: Any + unverified_target_name: Any + server_challenge: Any + server_target_name: Any + server_target_info: Any + server_version: Any + server_av_netbios_computer_name: Any + server_av_netbios_domain_name: Any + server_av_dns_computer_name: Any + server_av_dns_domain_name: Any + server_av_dns_forest_name: Any + server_av_target_name: Any + server_av_flags: Any + server_av_timestamp: Any + server_av_single_host_data: Any + server_av_channel_bindings: Any + server_av_flag_constrained: Any + server_av_flag_integrity: Any + server_av_flag_target_spn_untrusted: Any + current_encoding: Any + client_challenge: Any + server_target_info_raw: Any + def __init__(self, domain, user_name, password) -> None: ... + def get_client_flag(self, flag): ... + def get_negotiated_flag(self, flag): ... + def get_server_av_flag(self, flag): ... + def set_client_flag(self, flags) -> None: ... + def reset_client_flags(self) -> None: ... + def unset_client_flag(self, flags) -> None: ... + def create_negotiate_message(self): ... + def parse_challenge_message(self, message): ... + def create_authenticate_message(self): ... + @staticmethod + def pack_field(value, offset): ... + @staticmethod + def unpack_field(field_message): ... + @staticmethod + def unpack_av_info(info): ... + @staticmethod + def pack_av_info(avs): ... + @staticmethod + def pack_windows_timestamp(): ... + def compute_nt_response(self): ... + def ntowf_v2(self): ... diff --git a/stubs/ldap3/ldap3/utils/port_validators.pyi b/stubs/ldap3/ldap3/utils/port_validators.pyi new file mode 100644 index 000000000000..c120f02b89b9 --- /dev/null +++ b/stubs/ldap3/ldap3/utils/port_validators.pyi @@ -0,0 +1,2 @@ +def check_port(port): ... +def check_port_and_port_list(port, port_list): ... diff --git a/stubs/ldap3/ldap3/utils/repr.pyi b/stubs/ldap3/ldap3/utils/repr.pyi new file mode 100644 index 000000000000..f2c58e20ed4d --- /dev/null +++ b/stubs/ldap3/ldap3/utils/repr.pyi @@ -0,0 +1,5 @@ +from typing import Any + +repr_encoding: Any + +def to_stdout_encoding(value): ... diff --git a/stubs/ldap3/ldap3/utils/tls_backport.pyi b/stubs/ldap3/ldap3/utils/tls_backport.pyi new file mode 100644 index 000000000000..c21998013cf2 --- /dev/null +++ b/stubs/ldap3/ldap3/utils/tls_backport.pyi @@ -0,0 +1,3 @@ +class CertificateError(ValueError): ... + +def match_hostname(cert, hostname): ... diff --git a/stubs/ldap3/ldap3/utils/uri.pyi b/stubs/ldap3/ldap3/utils/uri.pyi new file mode 100644 index 000000000000..45ea8bb7699d --- /dev/null +++ b/stubs/ldap3/ldap3/utils/uri.pyi @@ -0,0 +1 @@ +def parse_uri(uri): ... diff --git a/stubs/ldap3/ldap3/version.pyi b/stubs/ldap3/ldap3/version.pyi new file mode 100644 index 000000000000..50be840c1d09 --- /dev/null +++ b/stubs/ldap3/ldap3/version.pyi @@ -0,0 +1,3 @@ +__url__: str +__description__: str +__status__: str