-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
python-ldap: add package stubs #16103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |||
| "stubs/geopandas", | ||||
| // test cases use a custom config file | ||||
| "**/@tests/test_cases", | ||||
| "python-ldap" | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, remove unrelated diffs
Suggested change
|
||||
| ], | ||||
| "typeCheckingMode": "strict", | ||||
| // Allowed in base settings for incomplete stubs, checked in stricter settings | ||||
|
|
||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also delete unused file? |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||||||||||||||||||||||||||||||||||
| version = "3.4.*" | ||||||||||||||||||||||||||||||||||||||
| dependencies = ["types-pyasn1"] | ||||||||||||||||||||||||||||||||||||||
| upstream-repository = "https://github.com/python-ldap/python-ldap" | ||||||||||||||||||||||||||||||||||||||
| extra-description = """ | ||||||||||||||||||||||||||||||||||||||
| Type stubs for python-ldap, covering the public API as documented at | ||||||||||||||||||||||||||||||||||||||
| https://www.python-ldap.org/doc/html/api.html. | ||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||
| partial-stub = true | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| [tool.stubtest] | ||||||||||||||||||||||||||||||||||||||
| stubtest-dependencies = ["python-ldap"] | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no need for extra description and adding the package itself to stubtest dependencies (it is already there)
Suggested change
|
||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| from typing import Any | ||
|
|
||
| __version__: str | ||
| __author__: str | ||
| __license__: str | ||
|
|
||
| LIBLDAP_API_INFO: Any | ||
| OPT_NAMES_DICT: dict[Any, Any] | ||
| OPT_ERROR_STRING: int | ||
| OPT_DIAGNOSTIC_MESSAGE: int | ||
|
|
||
| class LDAPLock: | ||
| def __init__(self, lock_class: Any = ..., desc: str = ...) -> None: ... | ||
| def acquire(self) -> None: ... | ||
| def release(self) -> None: ... | ||
|
|
||
| _ldap_module_lock: LDAPLock | ||
|
|
||
| def initialize( | ||
| uri: str, | ||
| trace_level: int = ..., | ||
| trace_file: Any = ..., | ||
| trace_stack_limit: Any = ..., | ||
| bytes_mode: Any = ..., | ||
| fileno: Any = ..., | ||
| **kwargs: Any, | ||
| ) -> Any: ... | ||
| def get_option(option: Any) -> Any: ... | ||
| def set_option(option: Any, invalue: Any) -> None: ... | ||
| def escape_str(escape_func: Any, s: Any, *args: Any) -> Any: ... | ||
| def strf_secs(secs: Any) -> Any: ... | ||
| def strp_secs(dt_str: Any) -> Any: ... | ||
|
|
||
| class NO_UNIQUE_ENTRY(Exception): ... | ||
| class LDAPBytesWarning(Warning): ... | ||
|
|
||
| from ldap.dn import explode_dn as explode_dn, explode_rdn as explode_rdn |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| from ldap.asyncsearch import * | ||
| from ldap.asyncsearch import __version__ as __version__ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| from typing import Any | ||
| from ldap import __version__ as __version__ | ||
|
|
||
| SEARCH_RESULT_TYPES: set[int] | ||
| ENTRY_RESULT_TYPES: set[int] | ||
|
|
||
| class WrongResultType(Exception): | ||
|
|
||
| receivedResultType: Any | ||
| expectedResultTypes: Any | ||
| def __init__(self, *args: Any, **kwargs: Any) -> None: ... | ||
|
|
||
| class AsyncSearchHandler: | ||
|
|
||
| beginResultsDropped: int | ||
| endResultBreak: int | ||
| def __init__(self, l: Any) -> None: ... | ||
| def startSearch( | ||
| self, | ||
| searchRoot: Any, | ||
| searchScope: Any, | ||
| filterStr: Any, | ||
| attrList: Any = ..., | ||
| attrsOnly: int = 0, | ||
| timeout: int = -1, | ||
| sizelimit: int = 0, | ||
| serverctrls: Any = ..., | ||
| clientctrls: Any = ..., | ||
| ) -> None: ... | ||
| def preProcessing(self) -> None: ... | ||
| def afterFirstResult(self) -> None: ... | ||
| def postProcessing(self) -> None: ... | ||
| def processResults(self, ignoreResultsNumber: int = 0, processResultsCount: int = 0, timeout: int = -1) -> bool: ... | ||
|
|
||
| class List(AsyncSearchHandler): | ||
|
|
||
| allResults: list[Any] | ||
| def __init__(self, l: Any) -> None: ... | ||
|
|
||
| class Dict(AsyncSearchHandler): | ||
|
|
||
| allEntries: dict[Any, Any] | ||
| def __init__(self, l: Any) -> None: ... | ||
|
|
||
| class IndexedDict(Dict): | ||
|
|
||
| indexed_attrs: Any | ||
| index: Any | ||
| def __init__(self, l: Any, indexed_attrs: Any = ...) -> None: ... | ||
|
|
||
| class FileWriter(AsyncSearchHandler): | ||
|
|
||
| headerStr: str | ||
| footerStr: str | ||
| def __init__(self, l: Any, f: Any, headerStr: str = "", footerStr: str = "") -> None: ... | ||
| def preProcessing(self) -> None: ... | ||
| def postProcessing(self) -> None: ... | ||
|
|
||
| class LDIFWriter(FileWriter): | ||
| def __init__(self, l: Any, writer_obj: Any, headerStr: str = "", footerStr: str = "") -> None: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| from typing import Any | ||
|
|
||
| class cidict(dict[Any, Any]): | ||
| def __init__(self, *args: Any, **kwargs: Any) -> None: ... | ||
| def __getitem__(self, key: Any) -> Any: ... | ||
| def __setitem__(self, key: Any, value: Any) -> None: ... | ||
| def __delitem__(self, key: Any) -> None: ... | ||
| def __contains__(self, key: Any) -> bool: ... | ||
| def get(self, key: Any, default: Any = ...) -> Any: ... | ||
| def setdefault(self, key: Any, default: Any = ...) -> Any: ... | ||
| def update(self, *args: Any, **kwargs: Any) -> None: ... | ||
| def pop(self, key: Any, default: Any = ...) -> Any: ... | ||
| def popitem(self) -> tuple[Any, Any]: ... | ||
| def clear(self) -> None: ... | ||
| def copy(self) -> cidict: ... | ||
| def keys(self) -> Any: ... | ||
| def items(self) -> Any: ... | ||
| def values(self) -> Any: ... | ||
| def __eq__(self, other: object) -> bool: ... | ||
| def __ne__(self, other: object) -> bool: ... | ||
|
|
||
| def strlist_minus(a: Any, b: Any) -> Any: ... | ||
| def strlist_intersection(a: Any, b: Any) -> Any: ... | ||
| def strlist_union(a: Any, b: Any) -> Any: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from collections import UserDict | ||
| from collections.abc import MutableMapping as MutableMapping | ||
| from shutil import which as which | ||
| from urllib.parse import quote as quote, quote_plus as quote_plus, unquote as unquote, urlparse as urlparse | ||
| from urllib.request import urlopen as urlopen | ||
|
|
||
| IterableUserDict = UserDict | ||
|
|
||
| def reraise(exc_type, exc_value, exc_traceback) -> None: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| from typing import Any | ||
|
|
||
| class Constant: | ||
| name: Any | ||
| requirements: Any | ||
| doc: Any | ||
| def __init__(self, name: str, optional: bool = False, requirements: Any = ..., doc: Any = ...) -> None: ... | ||
|
|
||
| class Error(Constant): | ||
| c_template: str | ||
|
|
||
| class Int(Constant): | ||
| c_template: str | ||
|
|
||
| class TLSInt(Int): | ||
| def __init__(self, *args: Any, **kwargs: Any) -> None: ... | ||
|
|
||
| class Feature(Constant): | ||
| c_template: Any | ||
| c_feature: Any | ||
| def __init__(self, name: str, c_feature: Any, **kwargs: Any) -> None: ... | ||
|
|
||
| class Str(Constant): | ||
| c_template: str | ||
|
|
||
| API_2004: str | ||
| CONSTANTS: Any | ||
|
|
||
| def print_header() -> None: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| from typing import Any | ||
| from ldap.controls.simple import BooleanControl, ManageDSAITControl, RelaxRulesControl, ValueLessRequestControl | ||
| from ldap.controls.libldap import AssertionControl, MatchedValuesControl, SimplePagedResultsControl | ||
|
|
||
| __all__ = [ | ||
| "KNOWN_RESPONSE_CONTROLS", | ||
| "AssertionControl", | ||
| "BooleanControl", | ||
| "LDAPControl", | ||
| "ManageDSAITControl", | ||
| "MatchedValuesControl", | ||
| "RelaxRulesControl", | ||
| "RequestControl", | ||
| "ResponseControl", | ||
| "SimplePagedResultsControl", | ||
| "ValueLessRequestControl", | ||
| "RequestControlTuples", | ||
| "DecodeControlTuples", | ||
| ] | ||
|
|
||
| KNOWN_RESPONSE_CONTROLS: Any | ||
|
|
||
| class RequestControl: | ||
| controlType: Any | ||
| criticality: Any | ||
| encodedControlValue: Any | ||
| def __init__(self, controlType: Any = ..., criticality: bool = False, encodedControlValue: Any = ...) -> None: ... | ||
| def encodeControlValue(self) -> Any: ... | ||
|
|
||
| class ResponseControl: | ||
| controlType: Any | ||
| criticality: Any | ||
| encodedControlValue: Any | ||
| def __init__(self, controlType: Any = ..., criticality: bool = False) -> None: ... | ||
| def decodeControlValue(self, encodedControlValue: Any) -> Any: ... | ||
|
|
||
| class LDAPControl(RequestControl, ResponseControl): | ||
| controlType: Any | ||
| criticality: Any | ||
| controlValue: Any | ||
| encodedControlValue: Any | ||
| def __init__( | ||
| self, controlType: Any = ..., criticality: bool = False, controlValue: Any = ..., encodedControlValue: Any = ... | ||
| ) -> None: ... | ||
|
|
||
| def RequestControlTuples(ldapControls: Any) -> Any: ... | ||
| def DecodeControlTuples(ldapControlTuples: Any, knownLDAPControls: Any = ...) -> Any: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from typing import Any | ||
| from ldap.controls import LDAPControl | ||
|
|
||
| DEREF_CONTROL_OID: str | ||
|
|
||
| class DereferenceControl(LDAPControl): | ||
| controlType: Any | ||
| derefSpecs: Any | ||
| def __init__(self, criticality: bool = False, derefSpecs: Any = ...) -> None: ... | ||
| def encodeControlValue(self): ... | ||
| derefRes: Any | ||
| def decodeControlValue(self, encodedControlValue) -> None: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| from typing import Any | ||
| from ldap.controls import ( | ||
| KNOWN_RESPONSE_CONTROLS as KNOWN_RESPONSE_CONTROLS, | ||
| LDAPControl as LDAPControl, | ||
| RequestControl as RequestControl, | ||
| ResponseControl as ResponseControl, | ||
| ) | ||
| from ldap.pkginfo import __version__ as __version__ | ||
|
|
||
| class AssertionControl(RequestControl): | ||
| controlType: Any | ||
| assertion: Any | ||
| def __init__(self, assertion: Any, criticality: bool = False) -> None: ... | ||
| def encodeControlValue(self): ... | ||
|
|
||
| class MatchedValuesControl(ResponseControl): | ||
| controlType: Any | ||
| matchedValues: Any | ||
| def __init__(self, matchedValues: Any, criticality: bool = False) -> None: ... | ||
| def decodeControlValue(self, encodedControlValue) -> None: ... | ||
|
|
||
| class SimplePagedResultsControl(RequestControl): | ||
| controlType: Any | ||
| size: int | ||
| cookie: Any | ||
| def __init__(self, size: int = 0, cookie: Any = ...) -> None: ... | ||
| def encodeControlValue(self): ... | ||
| def decodeControlValue(self, encodedControlValue) -> None: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| from typing import Any | ||
|
|
||
| from ldap.controls import ResponseControl, ValueLessRequestControl | ||
| from pyasn1.type import univ | ||
|
|
||
| __all__ = ["SearchNoOpControl", "SearchNoOpMixIn"] | ||
|
|
||
| class SearchNoOpControl(ValueLessRequestControl, ResponseControl): | ||
| controlType: str | ||
| criticality: Any # TODO: Precise type | ||
| def __init__(self, criticality: bool = False) -> None: ... | ||
|
|
||
| class SearchNoOpControlValue(univ.Sequence): ... | ||
| resultCode: Any # TODO: Precise type | ||
| numSearchResults: Any # TODO: Precise type | ||
| numSearchContinuations: Any # TODO: Precise type | ||
| def decodeControlValue(self, encodedControlValue) -> None: ... | ||
|
|
||
| class SearchNoOpMixIn: | ||
| def noop_search_st(self, base, scope=..., filterstr: str = "(objectClass=*)", timeout: int = -1): ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from typing import Any | ||
| from ldap.controls import RequestControl, ResponseControl | ||
|
|
||
| class SimplePagedResultsControl(RequestControl, ResponseControl): | ||
| controlType: Any | ||
| size: int | ||
| cookie: Any | ||
| def __init__(self, size: int = 0, cookie: Any = ...) -> None: ... | ||
| def encodeControlValue(self): ... | ||
| def decodeControlValue(self, encodedControlValue) -> None: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| from typing import Any | ||
| from ldap.controls import LDAPControl, ResponseControl | ||
|
|
||
| __all__ = ["PasswordExpiringControl", "PasswordExpiredControl"] | ||
|
|
||
| class PasswordPolicyControl(LDAPControl): | ||
| controlType: Any | ||
| def __init__(self, criticality: bool = False) -> None: ... | ||
| def encodeControlValue(self): ... | ||
| def decodeControlValue(self, encodedControlValue) -> None: ... | ||
|
|
||
| class PasswordExpiringControl(ResponseControl): | ||
| controlType: str | ||
| gracePeriod: Any # TODO: Precise type | ||
| def decodeControlValue(self, encodedControlValue) -> None: ... | ||
|
|
||
| class PasswordExpiredControl(ResponseControl): | ||
| controlType: str | ||
| passwordExpired: Any # TODO: Precise type | ||
| def decodeControlValue(self, encodedControlValue) -> None: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from typing import Any | ||
| from ldap.controls import LDAPControl | ||
|
|
||
| class PersistentSearchControl(LDAPControl): | ||
| controlType: Any | ||
| def __init__( | ||
| self, criticality: bool = False, changeTypes: Any = ..., changesOnly: bool = False, returnECs: bool = False | ||
| ) -> None: ... | ||
| def encodeControlValue(self): ... | ||
| def decodeControlValue(self, encodedControlValue) -> None: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from typing import Any | ||
|
|
||
| from ldap.controls import ResponseControl | ||
|
|
||
| __all__ = ["PasswordExpiringControl", "PasswordExpiredControl"] | ||
|
|
||
| class PasswordExpiringControl(ResponseControl): | ||
| controlType: str | ||
| gracePeriod: Any # TODO: Precise type | ||
| def decodeControlValue(self, encodedControlValue) -> None: ... | ||
|
|
||
| class PasswordExpiredControl(ResponseControl): | ||
| controlType: str | ||
| passwordExpired: Any # TODO: Precise type | ||
| def decodeControlValue(self, encodedControlValue) -> None: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| from typing import Any | ||
|
|
||
| from ldap.controls import KNOWN_RESPONSE_CONTROLS as KNOWN_RESPONSE_CONTROLS, LDAPControl as LDAPControl | ||
|
|
||
| class ReadEntryControl(LDAPControl): | ||
| def __init__(self, criticality: bool = False, attrList: Any | None = None) -> None: ... # TODO: Precise type for attrList | ||
| def encodeControlValue(self): ... | ||
| dn: Any # TODO: Precise type | ||
| entry: Any # TODO: Precise type | ||
| def decodeControlValue(self, encodedControlValue) -> None: ... | ||
|
|
||
| class PreReadControl(ReadEntryControl): | ||
| controlType: Any # TODO: Precise type | ||
|
|
||
| class PostReadControl(ReadEntryControl): | ||
| controlType: Any # TODO: Precise type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove unrelated diffs